/* Scoped presentation for the visit-count consent notice.
   Founder-approved web-home item 6 (2026-11-03): one 48px line pinned to the bottom
   of the viewport until the visitor decides, then removed. Its height is reserved at
   the end of the page so the last content can always scroll clear of it. Nothing is
   counted until a visitor chooses; no choice means no cookie. */
:root { --cookie-h: 0px; }
:root:not([data-hb-consent="hidden"]):has(body .hb-consent) { --cookie-h: 48px; }
:root:not([data-hb-consent="hidden"]) body:has(.hb-consent) { padding-bottom: var(--cookie-h); }
/* A page's own sticky download bar sits above the pinned notice, never under it. */
:root:not([data-hb-consent="hidden"]) body:has(.hb-consent) .sticky-dl:not(#_) { bottom: var(--cookie-h); }
.hb-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  width: 100%;
  margin: 0;
  min-block-size: 48px;
  background: var(--bg, var(--surface, #fff));
  border: 0;
  border-top: 1px solid var(--line, var(--border-strong, #777));
  border-radius: 0;
  box-shadow: none;
  padding: 0 16px env(safe-area-inset-bottom, 0px);
  color: var(--ink, var(--text, #222));
  font: 14px/20px var(--font-body, var(--font, sans-serif));
  box-sizing: border-box;
}
.hb-consent__inner { display: flex; align-items: center; gap: 16px; min-block-size: 47px; /* 48px with the 1px top border */ max-width: var(--page-max, var(--wrap-wide, 1120px)); margin: 0 auto; box-sizing: border-box; }
.hb-consent__copy { flex: 1 1 auto; min-width: 0; margin: 0; padding-block: 6px; overflow-wrap: anywhere; }
.hb-consent .hb-consent__error[hidden] { display: none; }
.hb-consent a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 4px; color: inherit; }
.hb-consent__footer { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.hb-consent__actions { display: flex; gap: 8px; min-width: 0; }
.hb-consent button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 14px/1 var(--font-display, var(--font, sans-serif));
  letter-spacing: 0;
  border-radius: 8px;
  padding: 0 14px;
  min-height: 40px;
  border: 1.5px solid var(--ink, var(--text, #222));
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  color: var(--ink, var(--text, #222));
}
.hb-consent button[data-choice="yes"] { background: var(--ink, var(--text, #222)); color: var(--bg, var(--surface, #fff)); }
/* Keep pill widths stable while the display font loads. */
.hb-consent button[data-choice="yes"] { inline-size: 90px; }
.hb-consent button[data-choice="no"] { inline-size: 94px; }
.hb-consent :focus-visible { outline: 3px solid var(--focus, var(--accent, #0066cc)); outline-offset: 2px; }
.hb-consent .hb-consent__error:not([hidden]) { display: block; max-width: var(--page-max, var(--wrap-wide, 1120px)); margin: 0 auto 8px; }
:root[data-hb-consent="hidden"] .hb-consent { display: none; }
/* Let the existing global menus take the full viewport while they are open. */
body:has(.hb-server-menu[open], #site-more[aria-expanded="true"]) .hb-consent { display: none; }
body:has(.hb-server-menu[open], #site-more[aria-expanded="true"]) { padding-bottom: 0; }
.hb-consent-toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom,0px)); z-index: 70; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.hb-consent-toast { display: flex; gap: 12px; align-items: center; background: var(--text, var(--ink, #222)); color: var(--surface, #fff); padding: 11px 14px; border-radius: 12px; font: 14px/1.55 var(--font-body, sans-serif); box-shadow: 0 10px 28px rgba(0,0,0,.2); }
/* Phone: the sentence on one line, the three controls on a second; 88px in all. */
@media (max-width: 600px) {
  :root:not([data-hb-consent="hidden"]):has(body .hb-consent) { --cookie-h: 88px; }
  .hb-consent__inner { flex-wrap: wrap; gap: 0 12px; min-block-size: 87px; align-content: center; }
  .hb-consent__copy { flex-basis: 100%; padding-block: 10px 0; min-block-size: 30px; }
  .hb-consent__footer { width: 100%; justify-content: space-between; min-block-size: 44px; }
}
