/* ==========================================================================
   Site header: one system for every page except the home page.
   Loaded last, so it replaces the older navbar rules in site.css,
   responsive.css, portrait-hero.css, unified-navbar.css and typography.css.

   Wide screens: a pinned bar with the wordmark, an Explore dropdown (card
   collection and tools), Reviews, Updates, Support and the theme switch.
   Phones (≤ 640px): the bar keeps the wordmark and switch; the links move to a
   floating tab bar at the bottom of the screen, within thumb reach, and Explore
   opens a sheet above it.
   ========================================================================== */

html[data-theme] body.unified-navbar {
  --hd-gutter: 20px;
  --hd-top: 12px;
  --hd-height: 60px;
  --hd-max: 1180px;
  --hd-surface: color-mix(in srgb, var(--page, #f5f5f7) 88%, transparent);
  --hd-surface-solid: var(--page, #f5f5f7);
  --hd-edge: color-mix(in srgb, var(--text, #1d1d1f) 9%, transparent);
  --hd-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 20px rgb(0 0 0 / 0.06);
  --hd-shadow-raised: 0 1px 2px rgb(0 0 0 / 0.05), 0 10px 30px rgb(0 0 0 / 0.09);
  --hd-link: color-mix(in srgb, var(--text, #1d1d1f) 72%, var(--page, #fff));
  --hd-fill: color-mix(in srgb, var(--text, #1d1d1f) 7%, transparent);
  --hd-fill-hover: color-mix(in srgb, var(--text, #1d1d1f) 5%, transparent);
  /* Phone tab bar glass */
  --hd-glass: linear-gradient(180deg, rgb(255 255 255 / 0.74), rgb(255 255 255 / 0.5));
  --hd-glass-edge: rgb(255 255 255 / 0.5);
  --hd-glass-rim: linear-gradient(135deg, rgb(255 255 255 / 0.95), rgb(255 255 255 / 0) 38%, rgb(255 255 255 / 0) 62%, rgb(255 255 255 / 0.7));
  --hd-glass-shadow: inset 0 1px 1px rgb(255 255 255 / 0.7), inset 0 -1px 1px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 30px rgb(0 0 0 / 0.12);
  --hd-glass-pill: linear-gradient(180deg, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.6));
  --hd-glass-pill-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 1px 2px rgb(0 0 0 / 0.08), 0 2px 8px rgb(0 0 0 / 0.06);
}
html[data-theme="dark"] body.unified-navbar {
  --hd-surface: color-mix(in srgb, #141416 86%, transparent);
  --hd-surface-solid: #141416;
  --hd-edge: rgb(255 255 255 / 0.1);
  --hd-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --hd-shadow-raised: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.5);
  --hd-link: color-mix(in srgb, var(--text, #f5f5f7) 76%, #000);
  --hd-fill: rgb(255 255 255 / 0.1);
  --hd-fill-hover: rgb(255 255 255 / 0.06);
  --hd-glass: linear-gradient(180deg, rgb(44 44 48 / 0.74), rgb(20 20 22 / 0.64));
  --hd-glass-edge: rgb(255 255 255 / 0.08);
  --hd-glass-rim: linear-gradient(135deg, rgb(255 255 255 / 0.4), rgb(255 255 255 / 0) 38%, rgb(255 255 255 / 0) 62%, rgb(255 255 255 / 0.22));
  --hd-glass-shadow: inset 0 1px 1px rgb(255 255 255 / 0.12), 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
  --hd-glass-pill: linear-gradient(180deg, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0.12));
  --hd-glass-pill-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 1px 3px rgb(0 0 0 / 0.35);
}
@media (min-width: 720px) {
  html[data-theme] body.unified-navbar { --hd-gutter: 32px; }
}
/* Anchor jumps land below the pinned bar (scroll padding belongs on the root). */
html[data-theme]:has(> body.unified-navbar) { scroll-padding-top: 92px; }
@media (max-width: 640px) {
  html[data-theme]:has(> body.unified-navbar) { scroll-padding-top: 84px; }
}

/* ---------- Bar position: pinned on every page ---------- */
html[data-theme] body.unified-navbar .topbar {
  position: sticky !important;
  top: var(--hd-top) !important;
  left: auto !important;
  z-index: 100 !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* ---------- The bar surface ---------- */
html[data-theme] body.unified-navbar .topbar-shell,
html[data-theme] body.unified-navbar .topbar-shell.scrolled {
  position: relative !important;
  isolation: isolate;
  overflow: visible !important;
  width: min(var(--hd-max), 100% - 2 * var(--hd-gutter)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  border: 1px solid var(--hd-edge) !important;
  border-radius: 999px !important;
  background: var(--hd-surface) !important;
  box-shadow: var(--hd-shadow) !important;
  /* The blur lives on ::before so the shell never becomes the containing
     block for the fixed tab bar inside it. */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
  transition-property: box-shadow !important;
  transition-duration: 200ms !important;
  transition-timing-function: ease-out !important;
}
html[data-theme] body.unified-navbar .topbar-shell.scrolled { box-shadow: var(--hd-shadow-raised) !important; }
html[data-theme] body.unified-navbar .topbar-shell::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  border-radius: inherit !important;
  background: none !important;
  opacity: 1 !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}
html[data-theme] body.unified-navbar .topbar-shell::after { content: none !important; display: none !important; }
@media (hover: hover) {
  html[data-theme] body.unified-navbar .topbar-shell:hover { border-color: var(--hd-edge) !important; }
}

html[data-theme] body.unified-navbar .topbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  height: var(--hd-height) !important;
  padding-block: 0 !important;
  padding-inline: 22px 10px !important;
  transition: none !important;
}

/* ---------- Wordmark ---------- */
html[data-theme] body.unified-navbar .wordmark {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px;
  transform: none !important;
  opacity: 1 !important;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme] body.unified-navbar .wordmark-brand { font-size: 0 !important; line-height: 0 !important; }
html[data-theme] body.unified-navbar .wordmark-brand::before { content: none !important; }
html[data-theme] body.unified-navbar .wordmark .brand-logo-svg {
  display: block;
  width: auto !important;
  height: 24px !important;
}

/* ---------- Actions: links + switch ---------- */
html[data-theme] body.unified-navbar .topbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}
html[data-theme] body.unified-navbar .topbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
html[data-theme] body.unified-navbar .topbar-links .collection-link {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 40px !important;
  min-width: 0 !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--hd-link) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transform: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition-property: background-color, color !important;
  transition-duration: 150ms !important;
  transition-timing-function: ease-out !important;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme] body.unified-navbar .topbar-links .collection-link::after { content: none !important; display: none !important; }
html[data-theme] body.unified-navbar .topbar-links .collection-link[aria-current] {
  background: var(--hd-fill) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
}
@media (hover: hover) {
  html[data-theme] body.unified-navbar .topbar-links .collection-link:not([aria-current]):hover {
    background: var(--hd-fill-hover) !important;
    color: var(--text) !important;
  }
}
html[data-theme] body.unified-navbar .topbar-links .collection-link:focus-visible {
  outline: 2px solid var(--focus, #075cff) !important;
  outline-offset: 2px !important;
}
html[data-theme] body.unified-navbar .nav-icon { display: none; flex: none; }

/* Theme switch: hairline divider before it, 44px tap area around it. */
html[data-theme] body.unified-navbar .topbar-actions .plane-switch {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-inline-start: 13px;
  padding-inline: 8px;
}
html[data-theme] body.unified-navbar .topbar-actions .plane-switch::before {
  content: "";
  position: absolute;
  inset-inline-start: -6px;
  inset-block: 12px;
  width: 1px;
  background: var(--hd-edge);
}

/* The tab-bar Explore button is for phones only. */
html[data-theme] body.unified-navbar .nav-tools-toggle { display: none !important; }

/* ---------- Explore menu (desktop and tablet) ----------
   The card collection and the tools sit behind one Explore button before the main
   links; it opens the same #navTools popover that phones open from the tab bar. */
html[data-theme] body.unified-navbar .nav-tools-menu {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  margin-inline-end: 2px;
  padding: 0 13px 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hd-link);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
html[data-theme] body.unified-navbar .nav-tools-menu .nav-chevron { flex: none; opacity: 0.7; transition: rotate 200ms cubic-bezier(0.23, 1, 0.32, 1); }
html[data-theme] body.unified-navbar .topbar-actions:has(.nav-tools-sheet:popover-open) .nav-tools-menu .nav-chevron { rotate: 180deg; }
@media (hover: hover) {
  html[data-theme] body.unified-navbar .nav-tools-menu:hover { background: var(--hd-fill-hover); color: var(--text); }
}
html[data-theme] body.unified-navbar .topbar-actions:has(.nav-tools-sheet:popover-open) .nav-tools-menu { background: var(--hd-fill-hover); color: var(--text); }
/* On the card collection or a tool page, Explore is the current section. */
html[data-theme] body.unified-navbar .nav-tools-menu.is-current { color: var(--text); font-weight: 600; }
html[data-theme] body.unified-navbar .nav-tools-menu:focus-visible { outline: 2px solid var(--focus, #075cff); outline-offset: 2px; }

/* ---------- Tablets ---------- */
@media (max-width: 900px) {
  html[data-theme] body.unified-navbar .topbar-links .collection-link { padding: 0 13px !important; font-size: 14px !important; }
  html[data-theme] body.unified-navbar .nav-tools-menu { padding: 0 11px 0 13px; font-size: 14px; }
}

/* ---------- Phones: links move to a bottom tab bar ---------- */
@media (max-width: 640px) {
  html[data-theme] body.unified-navbar {
    --hd-top: 10px;
    --hd-height: 56px;
    --hd-gutter: 12px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  html[data-theme] body.unified-navbar .topbar-inner { padding-inline: 18px 6px !important; }
  html[data-theme] body.unified-navbar .wordmark .brand-logo-svg { height: 21px !important; }
  html[data-theme] body.unified-navbar .topbar-actions .plane-switch { margin-inline-start: 0; }
  html[data-theme] body.unified-navbar .topbar-actions .plane-switch::before { content: none; }

  html[data-theme] body.unified-navbar .topbar-links {
    position: fixed;
    z-index: 101;
    inset-inline: 0;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: max-content;
    margin-inline: auto;
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--hd-glass-edge);
    border-radius: 999px;
    background: var(--hd-glass);
    box-shadow: var(--hd-glass-shadow);
    backdrop-filter: blur(16px) saturate(200%) brightness(1.04);
    -webkit-backdrop-filter: blur(16px) saturate(200%) brightness(1.04);
  }
  /* Liquid glass: a light rim that catches the top-left and bottom-right edges. */
  html[data-theme] body.unified-navbar .topbar-links::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    padding: 1px;
    border-radius: inherit;
    background: var(--hd-glass-rim);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
  }
  /* Same order as the desktop bar: Explore (card collection and tools, in the sheet
     below), Reviews, Updates, Support. */
  html[data-theme] body.unified-navbar .topbar-links > [data-nav="explore"] { order: 1; }
  html[data-theme] body.unified-navbar .topbar-links > [data-nav="reviews"] { order: 2; }
  html[data-theme] body.unified-navbar .topbar-links > [data-nav="updates"] { order: 3; }
  html[data-theme] body.unified-navbar .topbar-links > [data-nav="support"] { order: 4; }
  html[data-theme] body.unified-navbar .nav-tools-menu { display: none; }
  html[data-theme] body.unified-navbar .topbar-links > .nav-tools-toggle {
    display: inline-flex !important;
    font: inherit;
    cursor: pointer;
  }
  html[data-theme] body.unified-navbar .topbar-links .collection-link {
    flex-direction: column !important;
    gap: 3px !important;
    width: 84px !important;
    height: 52px !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
  }
  html[data-theme] body.unified-navbar .topbar-links .collection-link[aria-current],
  html[data-theme] body.unified-navbar .topbar-links .nav-tools-toggle.is-current {
    font-weight: 650 !important;
    background: var(--hd-glass-pill) !important;
    box-shadow: var(--hd-glass-pill-shadow) !important;
  }
  html[data-theme] body.unified-navbar .nav-icon { display: block; width: 22px; height: 22px; }
  /* The page you're on: brand-orange icon, same as the wordmark dot. */
  html[data-theme] body.unified-navbar .topbar-links .collection-link[aria-current] .nav-icon,
  html[data-theme] body.unified-navbar .topbar-links .nav-tools-toggle.is-current .nav-icon { color: #fc6e20; }
  html[data-theme] body.unified-navbar .topbar-links .collection-link > span {
    display: block;
    max-height: 16px;
    line-height: 16px;
    overflow: hidden;
  }

  /* Scrolling down (motion.js sets .nav-compact): the bar shrinks to icons only.
     The labels stay in the page, so each tab keeps its name for screen readers. */
  html.nav-compact[data-theme] body.unified-navbar .topbar-links .collection-link {
    gap: 0 !important;
    width: 56px !important;
    height: 44px !important;
  }
  html.nav-compact[data-theme] body.unified-navbar .topbar-links .collection-link > span {
    max-height: 0;
    opacity: 0;
  }

}

/* Four tabs: narrow them on small phones so the bar never overflows. */
@media (max-width: 400px) {
  html[data-theme] body.unified-navbar .topbar-links .collection-link { width: 76px !important; }
}
@media (max-width: 340px) {
  html[data-theme] body.unified-navbar .topbar-links { gap: 2px; padding: 4px; }
  html[data-theme] body.unified-navbar .topbar-links .collection-link { width: 68px !important; }
}

/* ---------- Phones: the Explore sheet ----------
   A native popover, so tapping outside, Escape and Back close it, and it sits
   above everything. Same liquid glass as the tab bar, opening just above it. */
.nav-tools-sheet { display: none; }
.nav-tools-sheet:popover-open { display: grid; }
.nav-tools-sheet.is-open { display: grid; }
html[data-theme] body.unified-navbar .nav-tools-sheet {
  position: fixed;
  inset: auto 0 calc(84px + env(safe-area-inset-bottom, 0px)) 0;
  width: min(366px, 100% - 24px);
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--hd-glass-edge);
  border-radius: 26px;
  background: var(--hd-glass);
  box-shadow: var(--hd-glass-shadow);
  color: var(--text);
  backdrop-filter: blur(32px) saturate(200%) brightness(1.04);
  -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(1.04);
  z-index: 102;
}
html[data-theme] body.unified-navbar .nav-tools-sheet::backdrop { background: rgb(0 0 0 / 0.12); }
html[data-theme="dark"] body.unified-navbar .nav-tools-sheet::backdrop { background: rgb(0 0 0 / 0.35); }
html[data-theme] body.unified-navbar .nav-tools-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 84px;
  padding: 12px 12px 11px;
  border-radius: 18px;
  background: var(--hd-fill-hover);
  color: var(--text) !important;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme] body.unified-navbar .nav-tools-link .nav-icon { display: block; width: 22px; height: 22px; color: var(--hd-link); }
/* My card collection leads the sheet across the full width. */
html[data-theme] body.unified-navbar .nav-tools-link--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 56px; }
html[data-theme] body.unified-navbar .nav-tools-link[aria-current] { background: var(--hd-glass-pill); box-shadow: var(--hd-glass-pill-shadow); font-weight: 650; }
html[data-theme] body.unified-navbar .nav-tools-link[aria-current] .nav-icon { color: #fc6e20; }
html[data-theme] body.unified-navbar .nav-tools-link:focus-visible { outline: 2px solid var(--focus, #075cff); outline-offset: 2px; }
/* Phones show tool names only; the one-line taglines are for the desktop dropdown. */
.nav-tools-tagline { display: none; }

/* Desktop and tablet: the same sheet drops down under the Explore button (motion.js
   places it), as a list with solid page-coloured surface like the bar. */
@media (min-width: 641px) {
  html[data-theme] body.unified-navbar .nav-tools-sheet {
    inset: var(--nav-menu-top, 80px) auto auto var(--nav-menu-left, 20px);
    width: 336px;
    margin: 0;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--hd-edge);
    border-radius: 20px;
    background: var(--hd-surface);
    box-shadow: var(--hd-shadow-raised);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transform-origin: 0 0;
  }
  html[data-theme] body.unified-navbar .nav-tools-sheet::backdrop { background: transparent; }
  html[data-theme] body.unified-navbar .nav-tools-link {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    background: transparent;
    font-size: 14.5px;
    font-weight: 500;
  }
  html[data-theme] body.unified-navbar .nav-tools-link .nav-icon { width: 20px; height: 20px; }
  html[data-theme] body.unified-navbar .nav-tools-link { min-height: 58px; padding: 9px 12px; }
  html[data-theme] body.unified-navbar .nav-tools-tagline {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    white-space: nowrap;
  }
  html[data-theme] body.unified-navbar .nav-tools-link[aria-current] { background: var(--hd-fill); box-shadow: none; font-weight: 600; }
  /* A hairline separates the card collection from the tools. */
  html[data-theme] body.unified-navbar .nav-tools-link--wide { position: relative; min-height: 58px; margin-bottom: 7px; }
  html[data-theme] body.unified-navbar .nav-tools-link--wide::after {
    content: "";
    position: absolute;
    inset: auto 12px -4px;
    height: 1px;
    background: var(--hd-edge);
  }
}
@media (min-width: 641px) and (hover: hover) {
  html[data-theme] body.unified-navbar .nav-tools-link:not([aria-current]):hover { background: var(--hd-fill-hover); }
}

/* ---------- Press feedback and preferences ---------- */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] body.unified-navbar .topbar-links .collection-link {
    transition-property: background-color, color, scale !important;
  }
  html[data-theme] body.unified-navbar .topbar-links .collection-link:active { scale: 0.96; }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] body.unified-navbar .nav-tools-link { transition: scale 150ms ease-out, background-color 150ms ease-out; }
  html[data-theme] body.unified-navbar .nav-tools-link:active { scale: 0.97; }
  html[data-theme] body.unified-navbar .nav-tools-sheet {
    transition: opacity 200ms ease-out, translate 260ms cubic-bezier(0.23, 1, 0.32, 1), scale 260ms cubic-bezier(0.23, 1, 0.32, 1), display 260ms allow-discrete, overlay 260ms allow-discrete;
    transform-origin: 50% 100%;
  }
  html[data-theme] body.unified-navbar .nav-tools-sheet:not(:popover-open):not(.is-open) { opacity: 0; translate: 0 10px; scale: 0.96; }
  @starting-style {
    html[data-theme] body.unified-navbar .nav-tools-sheet:popover-open { opacity: 0; translate: 0 10px; scale: 0.96; }
  }
  @media (min-width: 641px) {
    html[data-theme] body.unified-navbar .nav-tools-sheet:not(:popover-open):not(.is-open) { translate: 0 -6px; }
    @starting-style {
      html[data-theme] body.unified-navbar .nav-tools-sheet:popover-open { translate: 0 -6px; }
    }
  }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  html[data-theme] body.unified-navbar .topbar-links .collection-link {
    transition-property: background-color, color, scale, width, height, gap !important;
    transition-duration: 150ms, 150ms, 150ms, 300ms, 300ms, 300ms !important;
    transition-timing-function: ease-out, ease-out, ease-out, cubic-bezier(0.23, 1, 0.32, 1), cubic-bezier(0.23, 1, 0.32, 1), cubic-bezier(0.23, 1, 0.32, 1) !important;
  }
  html[data-theme] body.unified-navbar .topbar-links .collection-link > span {
    transition: max-height 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 180ms ease-out;
  }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-theme] body.unified-navbar .topbar-shell,
  html[data-theme] body.unified-navbar .topbar-shell.scrolled { background: var(--hd-surface-solid) !important; }
  html[data-theme] body.unified-navbar .topbar-shell::before { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  html[data-theme] body.unified-navbar .topbar-links { background: var(--hd-surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  html[data-theme] body.unified-navbar .topbar-links::before { content: none; }
  html[data-theme] body.unified-navbar .nav-tools-sheet { background: var(--hd-surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
  html[data-theme] body.unified-navbar .topbar-links { display: none; }
}

/* Selected text picks up the brand orange (text colour is unchanged). */
html[data-theme] body.unified-navbar ::selection { background: rgb(252 110 32 / 0.26); }

/* Affiliate label: put <span class="aff-tag">Affiliate link</span> next to any
   affiliate link, and give the link rel="sponsored noopener noreferrer". */
.aff-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #fc6e20 45%, transparent);
  background: color-mix(in srgb, #fc6e20 10%, transparent);
  color: #b13a0a;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
html[data-theme="dark"] .aff-tag { color: #ff9a5c; }
