/* THE APP BAR (r71) — one header for every signed-in tool page that is not the builder:
   /sign, /sign/edit/<id>, /tools, /tools/<slug>, /forms/jito. Amit, 8 Nov: "once I go into
   Sign a PDF the entire navigation is gone … the header should be constant for all of
   these." It is /app's own bar — same navy, same 64px, same lockup, same account button on
   the right — with the page's name after a hairline. js/appbar.js adds the lockup and the
   account button; the page keeps its own title, language picker and actions in between.
   `header.appbar` outranks each page's older `.bar` / `.lockup` rules, so the bar looks the
   same whichever stylesheet loaded before it. The public signer page (/esign/<token>) is
   for outside recipients and does not get it. */
header.appbar { display: flex; align-items: center; gap: 12px; box-sizing: border-box; height: 64px; min-height: 64px;
  padding: 0 24px; background: var(--so-bar, #0b1d32); color: #fff; font-family: var(--so-font, 'Montserrat', sans-serif); }
header.appbar .lockup { flex: none; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; border-radius: 8px; }
header.appbar .lockup img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
header.appbar .lockup .word { font: 700 16px/1.1 var(--so-font, 'Montserrat', sans-serif); letter-spacing: 2.4px; }
header.appbar .lockup .word small { display: block; margin-top: 3px; font-size: 10.5px; letter-spacing: 3px; color: var(--so-gold-400, #d4ba7a); }
header.appbar .ab-sep { flex: none; width: 1px; height: 28px; background: rgba(255,255,255,.24); }
header.appbar .ab-title { min-width: 0; font: 600 15px/20px var(--so-font, 'Montserrat', sans-serif); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.appbar .grow { flex: 1 1 auto; }
header.appbar .ab-back { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.38); border-radius: var(--so-r-md, 10px); color: #fff; text-decoration: none;
  font: 600 14px var(--so-font, 'Montserrat', sans-serif); white-space: nowrap; }
header.appbar .ab-back:hover { background: #2c4c7c; border-color: var(--so-gold, #c5a55a); }
header.appbar .ab-who { flex: none; font-size: 13px; color: rgba(255,255,255,.72); white-space: nowrap; }
header.appbar .ab-acct { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.38);
  background: transparent; color: #fff; font: 700 15px var(--so-font, 'Montserrat', sans-serif); cursor: pointer; padding: 0; }
header.appbar .ab-acct:hover, header.appbar .ab-acct[aria-expanded="true"] { background: #2c4c7c; border-color: var(--so-gold, #c5a55a); }
header.appbar .ab-acct[hidden] { display: none; }
header.appbar .lockup:focus-visible, header.appbar .ab-acct:focus-visible,
header.appbar a:focus-visible, header.appbar button:focus-visible { outline: 2px solid var(--so-gold, #c5a55a); outline-offset: 2px; }

/* the account menu: /app's own */
.ab-menu { position: absolute; z-index: 80; min-width: 220px; padding: 6px; margin: 0; box-sizing: border-box;
  background: var(--so-paper-000, #fff); border: 1px solid var(--so-stone-200, #e3ddd0); border-radius: var(--so-r-md, 10px);
  box-shadow: var(--so-shadow-dialog, 0 12px 32px rgba(11,29,50,.18)); font-family: var(--so-font, 'Montserrat', sans-serif); }
.ab-menu .who { padding: 8px 12px 10px; margin-bottom: 6px; font-size: 13px; line-height: 18px; color: var(--so-ink-500, #55606c);
  border-bottom: 1px solid var(--so-stone-200, #e3ddd0); }
.ab-menu .who b { display: block; color: var(--so-ink-900, #0b1d32); font-size: 14px; }
.ab-menu a, .ab-menu button { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; box-sizing: border-box;
  border-radius: var(--so-r-sm, 6px); background: none; color: var(--so-ink-900, #0b1d32); font: 500 14px var(--so-font, 'Montserrat', sans-serif);
  text-align: left; text-decoration: none; cursor: pointer; }
.ab-menu a:hover, .ab-menu button:hover, .ab-menu a:focus-visible, .ab-menu button:focus-visible { background: var(--so-btn-hover, #24406a); color: #fff; outline: none; }

@media (max-width: 900px) { header.appbar .ab-who { display: none; } }
@media (max-width: 600px) { header.appbar .ab-back { width: 40px; padding: 0; justify-content: center; } header.appbar .ab-back span { display: none; } }
@media (max-width: 700px) {
  header.appbar { padding: 0 16px; gap: 8px; }
  /* the mark alone on a phone, so the page's name keeps its room */
  header.appbar.titled .lockup .word { display: none; }
}
/* r74: the theme switch joined the bar. On a phone the bar's page name was already cut to
   "Sign …" and would now be a single letter, so where the page carries its own heading
   (Sign a PDF, PDF tools, a tool, JITO) the bar drops the name — the heading says it. */
@media (max-width: 480px) {
  body:has(h1:not(.ab-title)) header.appbar .ab-title,
  body:has(h1:not(.ab-title)) header.appbar .ab-sep { display: none; }
}
/* r74: at 360-380px a signed-in tool page carries lockup, back, PDF tools, language, theme and
   account — 10px too many at 8px gaps. Tighten the gaps and padding, never the 44px targets. */
@media (max-width: 380px) {
  header.appbar { gap: 6px; padding: 0 12px; }
}
