/* Hanna CRM top bar fixes from the 8 Nov 2026 QA (kit crmqa1). Loaded last in <head>.
 * Colours come from the pill guard's variables (hanna-pill-guard.js), so dark, colour and light themes follow the
 * same pill rule as the other apps: filled accent pill with dark bold text; in light themes no fill, accent text and
 * a thin accent outline. The :is(#..) parts only add weight: the pill guard's own rule for top-bar buttons carries
 * an ID's weight, and this one has to win over it for the brand pill. */

/* 1. One "HANNA WORKSPACE · CRM" pill (was the lower-case "hanna" logo with an invisible "CRM", accent on accent) */
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button):is(#hcq-b, .brand-button) {
  height: 34px !important; min-height: 34px !important; max-height: 34px; box-sizing: border-box !important;
  padding: 0 14px 0 8px !important; border-radius: 7px !important; gap: 8px !important;
  display: inline-flex !important; align-items: center !important; justify-content: flex-start !important; flex: none !important;
  background: var(--hm-pill-bg, var(--ht-accent, #35c8ee)) !important; background-image: none !important; box-shadow: none !important;
  color: var(--hm-pill-ink, var(--ht-accent-ink, #06131e)) !important; border: 1px solid var(--hm-pill-line, transparent) !important;
  white-space: nowrap !important;
}
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button) .brand-mark {
  width: 26px !important; height: 26px !important; flex: none !important; display: inline-flex !important; align-items: center; justify-content: center;
  font-size: 0 !important; color: var(--hm-pill-ink, var(--ht-accent-ink, #06131e)) !important; background: transparent !important; box-shadow: none !important; border: 0 !important;
}
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button) hanna-seal {
  --seal-size: 26px !important; width: 26px !important; height: 26px !important;
  --seal-ink: var(--hm-pill-ink, var(--ht-accent-ink, #06131e)); --seal-ring: var(--hm-pill-ink, var(--ht-accent-ink, #06131e));
  --seal-a: var(--hm-pill-ink, var(--ht-accent-ink, #06131e)); --seal-b: var(--hm-pill-ink, var(--ht-accent-ink, #06131e));
  filter: none !important; box-shadow: none !important;
}
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button) .brand-name {
  font-size: 0 !important; letter-spacing: 0 !important; line-height: 1 !important; color: var(--hm-pill-ink, var(--ht-accent-ink, #06131e)) !important;
}
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button) .brand-name > span { display: none !important; }
html body header.topbar > button.brand-button:is(#hcq-a, .brand-button) .brand-name::before {
  content: "Hanna Workspace\00a0\00a0\00B7\00a0\00a0 CRM";
  font: 700 12px/1 var(--ht-font, Inter, "Segoe UI", system-ui, sans-serif); letter-spacing: .04em; text-transform: uppercase;
  color: var(--hm-pill-ink, var(--ht-accent-ink, #06131e));
}

/* 2. "Ctrl K" on the commands pill: the key chip takes the pill's text colour (it was grey on the accent fill) */
html body header.topbar .topbar-actions > button kbd {
  color: inherit !important; background: transparent !important; border-color: currentColor !important; opacity: 1 !important;
  font: 700 11px/1.5 var(--ht-font, Inter, "Segoe UI", system-ui, sans-serif) !important;
}

/* 3. The side rails start under the top bar (it is 85px tall when the centred pill has its own row), so they no
 *    longer cover Options on the right or the seal on the left. --crm-top is set by hanna-crm-qafix.js. */
@media (min-width: 901px) {
  html body .shell.pills > nav.pill-rail { top: max(64px, var(--crm-top, 64px)) !important; }
}
