/* The one top bar on every page: public, portal and admin (src/lib/site-shell.ts headerHtml).
   Self-contained on purpose: its own values, so no page stylesheet can make it
   look different anywhere. Light only (23 Nov). */
.topbar {
  --tb-bg: #f6f3ee; --tb-ink: #1f1d1a; --tb-muted: #6b665e; --tb-rule: #d8d1c3; --tb-accent: #7a5c3e;
  --tb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative; z-index: 30; background: var(--tb-bg); border-bottom: 1px solid var(--tb-rule);
  font: 400 15px/1 var(--tb-font); -webkit-font-smoothing: antialiased;
}
.topbar *, .topbar *::before, .topbar *::after { box-sizing: border-box; }
.topbar .topbar-inner { max-width: 64rem; height: 60px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; }
.topbar .topbar-mark { margin-right: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--tb-ink); text-decoration: none; font: 700 14px/1 var(--tb-font); letter-spacing: 0.08em; }
.topbar .topbar-e { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: var(--tb-ink); color: var(--tb-bg); font: 700 15px/1 var(--tb-font); letter-spacing: 0; }
.topbar .topbar-nav { display: flex; align-items: center; gap: 24px; }
.topbar .topbar-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--tb-muted); font: 400 15px/1 var(--tb-font); letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.topbar .topbar-nav a:hover { color: var(--tb-ink); }
.topbar .topbar-nav a[aria-current="page"] { color: var(--tb-ink); text-decoration: underline; text-decoration-color: var(--tb-accent); text-decoration-thickness: 2px; text-underline-offset: 0.55em; }
.topbar .topbar-nav a:focus-visible, .topbar .topbar-mark:focus-visible, .topbar button:focus-visible { outline: 2px solid var(--tb-accent); outline-offset: 2px; border-radius: 2px; }
.topbar .topbar-menu { display: none; align-items: center; min-height: 44px; margin: 0 -8px 0 0; padding: 0 8px; border: 0; background: none; color: var(--tb-ink); font: 600 15px/1 var(--tb-font); cursor: pointer; }

/* Phones: the same Menu button in the same place on every page, opening the same list. */
@media (max-width: 47.99rem) {
  .topbar .topbar-inner { gap: 8px; }
  .topbar .topbar-menu { display: inline-flex; }
  .topbar .topbar-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 0 16px 8px; background: var(--tb-bg); border-bottom: 1px solid var(--tb-rule); }
  .topbar[data-open] .topbar-nav { display: flex; }
  .topbar .topbar-nav a { min-height: 52px; border-top: 1px solid var(--tb-rule); }
}

/* Admin pages: the row of section links under the bar (a client's pages, the System pages). */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 12px 0; margin: 0 0 8px; border-bottom: 1px solid var(--rule, #d8d1c3); font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.subnav strong { font-weight: 600; margin-right: 4px; }
.subnav a { color: var(--muted, #6b665e); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.subnav a:hover { color: var(--ink, #1f1d1a); }
.subnav a[aria-current="page"] { color: var(--ink, #1f1d1a); text-decoration: underline; text-decoration-color: var(--accent, #7a5c3e); text-underline-offset: 0.4em; }

/* Admin's older stylesheets style every <button>; the bar's own buttons stay plain in every state. */
.topbar button.topbar-menu, .topbar button.topbar-menu:hover, .topbar button.topbar-menu:focus, .topbar button.topbar-menu:active,
.topbar button.topbar-menu:hover, .topbar button.topbar-menu:active, .topbar button.topbar-menu[aria-expanded="true"] { color: var(--tb-ink); }

/* Admin body: the same breathing room under the bar that public and portal pages have. */
body.app > .wrap > main { padding-top: 24px; }
body.app > .wrap > .subnav + main, body.app > .wrap > .subnav ~ main { padding-top: 8px; }
