/* ==========================================================================
   Shared Site Header, Navigation, Search Modal, Mobile Drawer & Download Dock
   Shared by Next.js marketing site and Astro blog.
   Brand fonts: Fraunces (wordmark & display headings) + Inter (UI & body).
   ========================================================================== */

.site-header {
  --sb-nav-height: 58px;
  --sb-ink: #1f171a;
  --sb-muted: #675b5f;
  --sb-hairline: rgba(31, 23, 26, 0.08);
  --sb-surface: rgba(255, 255, 255, 0.94);
  --sb-berry: var(--sb-berry-500, #d91548);
  --sb-berry-hover: var(--sb-berry-600, #b8103d);
  --sb-berry-soft: #fff2f5;
  position: fixed;
  top: var(--site-announcement-offset, 0px);
  left: 0;
  right: 0;
  z-index: 160;
  height: var(--sb-nav-height);
  margin: 0;
  padding: 0;
  background: var(--sb-surface);
  border-bottom: 1px solid var(--sb-hairline);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  font-family: var(--_font-default);
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(31, 23, 26, 0.09);
  box-shadow: 0 2px 18px rgba(31, 23, 26, 0.05);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* Brand lockup: Berry mark + Fraunces wordmark (matches Scribeberry App onboarding) */
.site-header__identity {
  grid-column: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--sb-berry);
  transition: opacity 0.18s ease;
}

.site-header__brand:hover {
  opacity: 0.88;
}

/* Same lockup as the web app sidebar: round portrait chip + serif wordmark */
.site-header__logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid rgba(31, 23, 26, 0.12);
  border-radius: 999px;
  background: #fff;
  object-fit: cover;
}

.site-header__wordmark {
  font-family: var(--_font-accent);
  font-size: 22px;
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1;
  padding-bottom: 1px;
  color: inherit;
  white-space: nowrap;
}

/* Desktop primary navigation */
.site-header .header-nav {
  display: none;
  grid-column: 2;
  justify-self: center;
  align-items: center;
  min-width: 0;
}

.header-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav__item {
  position: relative;
  display: flex;
  align-items: center;
}

.header-nav__trigger,
.header-nav__item > .header-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sb-ink);
  font-family: var(--_font-default);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.header-nav__trigger .header-nav__link {
  color: inherit;
  font: inherit;
  padding: 0;
  background: none;
  border: 0;
}

.header-nav__trigger:hover,
.header-nav__item > .header-nav__link:hover,
.header-nav__item.is-open .header-nav__trigger {
  background: rgba(31, 23, 26, 0.055);
  color: var(--sb-ink);
}

.header-nav__item.active > .header-nav__link,
.header-nav__item.active .header-nav__trigger {
  color: var(--sb-berry);
}

.header-nav__chevron {
  flex: none;
  color: var(--sb-muted);
  transition: transform 0.2s ease, color 0.16s ease;
}

.header-nav__item.is-open .header-nav__chevron {
  transform: rotate(180deg);
  color: var(--sb-berry);
}

/* Dropdown panels — single-open JS state (.is-open), never fighting CSS :hover */
.header-nav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  padding: 10px;
  border: 1px solid rgba(31, 23, 26, 0.09);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 23, 26, 0.06), 0 20px 44px rgba(31, 23, 26, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.985);
  transform-origin: top left;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.header-nav__panel--right {
  left: auto;
  right: 0;
  transform-origin: top right;
}

.header-nav__panel::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}

.header-nav__item.is-open .header-nav__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.header-nav__panel--stack {
  width: 332px;
}

.header-nav__panel--cols-1 {
  width: 320px;
}

.header-nav__panel--cols-2 {
  width: 556px;
}

.header-nav__panel--cols-3 {
  width: 780px;
}

.header-nav__groups {
  display: grid;
  grid-template-columns: repeat(var(--group-cols, 2), minmax(0, 1fr));
  gap: 8px;
}

.header-nav__groups--stacked {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header-nav__group {
  grid-column: span var(--span, 1);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-nav__group-links {
  display: grid;
  grid-template-columns: repeat(var(--span, 1), minmax(0, 1fr));
  gap: 2px 4px;
}

.header-nav__group--bordered {
  border-right: 1px solid rgba(31, 23, 26, 0.07);
  padding-right: 10px;
}

.header-nav__group--divided {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(31, 23, 26, 0.08);
}

.header-nav__group-label {
  margin: 0;
  padding: 6px 10px 6px;
  color: #85777c;
  font-family: var(--_font-default);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.header-nav__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 2px;
}

.header-nav__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--sb-ink);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.header-nav__card:hover,
.header-nav__card.active {
  background: #f8f4f5;
}

.header-nav__card--featured {
  background: var(--sb-berry-soft);
}

.header-nav__card--featured:hover {
  background: #ffe6ec;
}

.header-nav__card--compact {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Icon tiles — every row gets the same 32px tile: a tinted icon or a partner mark */
.nav-tone--berry { --tone-fg: #c8103f; --tone-bg: #ffe8ee; }
.nav-tone--rose { --tone-fg: #be123c; --tone-bg: #ffe4e8; }
.nav-tone--pink { --tone-fg: #be185d; --tone-bg: #fce7f3; }
.nav-tone--orange { --tone-fg: #c2410c; --tone-bg: #ffedd5; }
.nav-tone--amber { --tone-fg: #a16207; --tone-bg: #fef3c7; }
.nav-tone--green { --tone-fg: #15803d; --tone-bg: #dcfce7; }
.nav-tone--teal { --tone-fg: #0f766e; --tone-bg: #ccfbf1; }
.nav-tone--sky { --tone-fg: #0369a1; --tone-bg: #e0f2fe; }
.nav-tone--indigo { --tone-fg: #4338ca; --tone-bg: #e0e7ff; }
.nav-tone--violet { --tone-fg: #6d28d9; --tone-bg: #ede9fe; }
.nav-tone--slate { --tone-fg: #475569; --tone-bg: #eef1f5; }

.header-nav__tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--tone-bg, #eef1f5);
  color: var(--tone-fg, #475569);
  transition: transform 0.16s ease;
}

.header-nav__tile--logo {
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(31, 23, 26, 0.1);
}

.header-nav__tile--logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-nav__card:hover .header-nav__tile,
.site-header__mobile-link:hover .header-nav__tile {
  transform: scale(1.06);
}

.header-nav__card--featured .header-nav__tile,
.site-header__mobile-link--featured .header-nav__tile {
  background: #fff;
}

.header-nav__tile-icon,
.sb-search-modal__svg {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.header-nav__tile-icon--clinical {
  width: 23px;
  height: 23px;
}

.header-nav__tile-icon > svg,
.sb-search-modal__svg > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.header-nav__card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-nav__card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sb-ink);
  font-family: var(--_font-default);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.header-nav__card:hover .header-nav__card-title,
.header-nav__card.active .header-nav__card-title {
  color: #0e0a0b;
}

.header-nav__card-desc {
  color: var(--sb-muted);
  font-family: var(--_font-default);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
}

.header-nav__card-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(217, 21, 72, 0.11);
  color: var(--sb-berry-700, #9a0d33);
  font-family: var(--_font-default);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Header actions */
.site-header__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-header__search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sb-ink);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.site-header__search-btn:hover {
  background: rgba(31, 23, 26, 0.06);
}

.sb-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--_font-default);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.sb-nav-btn--primary {
  background: var(--sb-berry-500, #d91548);
  border-color: var(--sb-berry-500, #d91548);
  color: #fff;
  box-shadow: 0 1px 2px rgba(217, 21, 72, 0.22);
}

.sb-nav-btn--primary:hover {
  background: var(--sb-berry-600, #b8103d);
  border-color: var(--sb-berry-600, #b8103d);
  color: #fff;
}

.sb-nav-btn--secondary {
  background: #fff;
  border-color: rgba(31, 23, 26, 0.16);
  color: var(--sb-ink);
}

.sb-nav-btn--secondary:hover {
  background: #f8f4f5;
  border-color: rgba(31, 23, 26, 0.28);
  color: var(--sb-ink);
}

.sb-nav-btn--dark {
  background: #1c1116;
  border-color: #1c1116;
  color: #fff;
}

.sb-nav-btn--dark:hover {
  background: #2f1d24;
  border-color: #2f1d24;
  color: #fff;
}

.sb-nav-btn--full {
  width: 100%;
  height: 44px;
  font-size: 14.5px;
}

/* Hide Try It Now pill on narrow phones; Open App stays 1-tap visible everywhere */
.site-header .header-try-btn {
  display: none;
}

.site-header .header-open-app {
  height: 36px;
  padding: 0 13px;
  font-size: 13px;
}

/* Mobile / Tablet menu toggle */
.site-header__burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(31, 23, 26, 0.14);
  border-radius: 10px;
  background: transparent;
  color: var(--sb-ink);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.site-header__burger:hover {
  background: rgba(31, 23, 26, 0.05);
}

.site-header__burger-icon--close {
  display: none;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-icon--open {
  display: none;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-icon--close {
  display: block;
}

/* Mobile & Tablet Full-Height Drawer */
.site-header:has(.site-header__burger[aria-expanded="true"]) {
  z-index: 250;
}

.site-header__menu {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: #fffdfb;
  color: var(--sb-ink);
  font-family: var(--_font-default);
}

.site-header__menu[hidden] {
  display: none;
}

.site-header__menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(31, 23, 26, 0.08);
  background: #fffdfb;
}

.site-header__brand--drawer {
  color: var(--sb-berry);
}

.site-header__drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 23, 26, 0.12);
  border-radius: 10px;
  background: #fff;
  color: var(--sb-ink);
  cursor: pointer;
}

.site-header__menu-search-wrap {
  flex: none;
  padding: 14px 16px 4px;
}

.site-header__menu-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(31, 23, 26, 0.12);
  border-radius: 12px;
  background: #f9f6f5;
  color: var(--sb-muted);
  font-family: var(--_font-default);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.site-header__menu-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 24px;
}

.site-header__mobile-section,
.site-header__mobile-direct {
  border-bottom: 1px solid rgba(31, 23, 26, 0.08);
}

.site-header__mobile-summary,
.site-header__mobile-direct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 2px;
  border: 0;
  background: transparent;
  color: var(--sb-ink);
  font-family: var(--_font-accent);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.site-header__mobile-summary::-webkit-details-marker {
  display: none;
}

.site-header__mobile-chevron {
  flex: none;
  color: var(--sb-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.site-header__mobile-section[open] .site-header__mobile-chevron {
  transform: rotate(180deg);
  color: var(--sb-berry);
}

.site-header__mobile-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 18px;
}

.site-header__mobile-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-header__mobile-group-label {
  margin: 0 0 4px;
  padding: 0 8px;
  color: #85777c;
  font-family: var(--_font-default);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-header__mobile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: var(--sb-ink);
  text-decoration: none;
}

.site-header__mobile-link:hover,
.site-header__mobile-link[aria-current="page"] {
  background: #f6f1f2;
}

.site-header__mobile-link--featured {
  background: var(--sb-berry-soft);
}

.site-header__mobile-link--compact {
  padding-top: 6px;
  padding-bottom: 6px;
}

.site-header__mobile-group--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 4px;
}

.site-header__mobile-group--grid .site-header__mobile-group-label {
  grid-column: 1 / -1;
}

.site-header__mobile-group--grid .site-header__mobile-link {
  gap: 10px;
  padding-right: 4px;
  padding-left: 6px;
}

.site-header__mobile-group--grid .site-header__mobile-link-title {
  white-space: nowrap;
}

@media (max-width: 379px) {
  .site-header__mobile-group--grid .site-header__mobile-link {
    gap: 8px;
  }

  .site-header__mobile-group--grid .header-nav__tile {
    width: 28px;
    height: 28px;
  }

  .site-header__mobile-group--grid .site-header__mobile-link-title {
    font-size: 13.5px;
  }
}

/* Tablet drawer: every group uses two columns so the panel isn't half empty */
@media (min-width: 600px) {
  .site-header__mobile-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
  }

  .site-header__mobile-group-label {
    grid-column: 1 / -1;
  }
}

.site-header__mobile-link-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-header__mobile-link-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--sb-ink);
}

.site-header__mobile-link-desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--sb-muted);
}

.site-header__menu-footer {
  flex: none;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(31, 23, 26, 0.08);
  background: #fff;
}

.site-header__menu-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.site-header__menu-quick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 12px;
}

.site-header__menu-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sb-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

.site-header__menu-quick-link:hover {
  color: var(--sb-berry);
}

@layer vendor {
  body.site-menu-open {
    overflow: hidden !important;
  }
}

/* Homepage hero transparent treatment (switches to solid white bar on scroll).
   Scoped to the top bar only (never leaks into the light mobile drawer). */
html:has(.hero-cinematic) .site-header:not(.is-scrolled) {
  /* No border over the film: a transparent border lets the gradient tile into
     it and paints a dark hairline across the video. */
  background: linear-gradient(180deg, rgba(16, 11, 14, 0.56) 0%, rgba(16, 11, 14, 0.22) 72%, rgba(16, 11, 14, 0) 100%) border-box;
  border-bottom-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__identity .site-header__brand {
  color: #fff;
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__trigger,
html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__item > .header-nav__link,
html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__search-btn {
  color: rgba(255, 255, 255, 0.94);
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__chevron {
  color: rgba(255, 255, 255, 0.72);
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__trigger:hover,
html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__item > .header-nav__link:hover,
html:has(.hero-cinematic) .site-header:not(.is-scrolled) .header-nav__item.is-open .header-nav__trigger,
html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__search-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__actions > .sb-nav-btn--secondary {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__actions > .sb-nav-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.52);
}

html:has(.hero-cinematic) .site-header:not(.is-scrolled) .site-header__burger {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(16, 11, 14, 0.28);
  color: #fff;
}

body.site-menu-open .woot--bubble-holder,
body.site-menu-open .woot-widget-bubble,
body:has(.sb-dl.is-open) .woot--bubble-holder,
body:has(.sb-dl.is-open) .woot-widget-bubble {
  display: none !important;
}

/* ==========================================================================
   Site Search Modal (⌘K)
   ========================================================================== */
.sb-search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(11vh, 88px) 16px 24px;
  background: rgba(20, 12, 16, 0.48);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: var(--_font-default);
}

.sb-search-modal {
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  border: 1px solid rgba(31, 23, 26, 0.1);
  border-radius: 20px;
  background: #fffdfb;
  box-shadow: 0 24px 64px rgba(20, 12, 16, 0.24);
}

.sb-search-modal__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid rgba(31, 23, 26, 0.08);
}

.sb-search-modal__icon {
  flex: none;
  color: #85777c;
}

.sb-search-modal__input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  color: #1f171a;
  font-family: var(--_font-default);
  font-size: 15.5px;
  outline: none;
}

.sb-search-modal__input::placeholder {
  color: #93868b;
}

.sb-search-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #675b5f;
  cursor: pointer;
}

.sb-search-modal__close:hover {
  background: rgba(31, 23, 26, 0.06);
  color: #1f171a;
}

.sb-search-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 4px;
}

.sb-search-modal__chip {
  padding: 5px 11px;
  border: 1px solid rgba(31, 23, 26, 0.11);
  border-radius: 999px;
  background: #fff;
  color: #4b3f43;
  font-family: var(--_font-default);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.sb-search-modal__chip:hover {
  border-color: rgba(217, 21, 72, 0.35);
  background: #fff2f5;
  color: var(--sb-berry-600, #b8103d);
}

.sb-search-modal__results {
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding: 10px 10px 12px;
}

.sb-search-modal__heading {
  margin: 0 0 6px;
  padding: 4px 10px;
  color: #85777c;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sb-search-modal__empty {
  padding: 32px 16px;
  text-align: center;
  color: #675b5f;
  font-size: 14px;
}

.sb-search-modal__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #1f171a;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.sb-search-modal__item.is-active,
.sb-search-modal__item:hover {
  background: #f7f1f3;
}

.sb-search-modal__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  color: #776a6e;
}

.sb-search-modal__item.is-active .sb-search-modal__item-icon {
  color: var(--sb-berry-500, #d91548);
}

.sb-search-modal__svg {
  width: 18px;
  height: 18px;
}

.sb-search-modal__svg--clinical {
  width: 21px;
  height: 21px;
}

.sb-search-modal__item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-search-modal__item-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f171a;
}

.sb-search-modal__item-desc {
  font-size: 12.5px;
  color: #675b5f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-search-modal__item-cat {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 23, 26, 0.05);
  color: #675b5f;
  font-size: 11px;
  font-weight: 500;
}

.sb-search-modal__item-arrow {
  flex: none;
  color: #9a8d91;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.sb-search-modal__item.is-active .sb-search-modal__item-arrow {
  opacity: 1;
  color: var(--sb-berry-500, #d91548);
  transform: translateX(2px);
}

.sb-search-modal__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  border-top: 1px solid rgba(31, 23, 26, 0.07);
  background: #faf7f6;
  color: #85777c;
  font-size: 11.5px;
}

/* ==========================================================================
   Download tab + pull-down drawer. The tab hangs from the bottom of the fixed
   header (so it is always at the top of the screen); opening it pulls a
   fixed-height panel down from under the nav and the tab rides along as its handle.
   ========================================================================== */
.sb-dl {
  --dl-nav: 58px;
  --dl-top: calc(var(--site-announcement-offset, 0px) + var(--dl-nav));
  --dl-h: 392px;
  --dl-w: min(960px, calc(100vw - 32px));
  --dl-right: max(16px, calc((100vw - 1440px) / 2 + 16px));
  --dl-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  font-family: var(--_font-default);
}

.sb-dl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 155;
  background: rgba(16, 11, 14, 0.3);
  animation: sb-dl-fade 0.25s ease;
}

@keyframes sb-dl-fade {
  from { opacity: 0; }
}

/* The handle */
.sb-dl-tab {
  position: fixed;
  top: var(--dl-top);
  right: calc(var(--dl-right) + 20px);
  z-index: 158;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 7px;
  border: 1px solid rgba(31, 23, 26, 0.1);
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background: #fff;
  color: #1f171a;
  font: 600 13px/1 var(--_font-default);
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 10px 22px -8px rgba(31, 23, 26, 0.28);
  transition: transform 0.38s var(--dl-ease), box-shadow 0.2s ease;
}

.sb-dl-tab:hover {
  box-shadow: 0 12px 26px -8px rgba(31, 23, 26, 0.36);
}

.sb-dl-tab:focus-visible {
  outline: 2px solid var(--sb-berry-500, #d91548);
  outline-offset: 2px;
}

.sb-dl.is-open .sb-dl-tab {
  transform: translateY(calc(var(--dl-h) - 1px));
}

.sb-dl-tab__icons {
  position: relative;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  background: var(--sb-berry-500, #d91548);
  color: #fff;
  overflow: hidden;
}

.sb-dl-tab__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(70%) scale(0.7);
  transition: opacity 0.4s ease, transform 0.5s var(--dl-ease);
}

.sb-dl-tab__icon.is-current {
  opacity: 1;
  transform: none;
}

.sb-dl-tab__icon.is-past {
  transform: translateY(-70%) scale(0.7);
}

.sb-dl-tab__chevron {
  color: #85777c;
  transition: transform 0.3s var(--dl-ease);
}

.sb-dl.is-open .sb-dl-tab__chevron {
  transform: rotate(180deg);
}

/* The panel */
.sb-dl-sheet,
.sb-dl-sheet p,
.sb-dl-sheet button {
  font-family: var(--_font-default);
}

.sb-dl-sheet {
  position: fixed;
  top: var(--dl-top);
  right: var(--dl-right);
  z-index: 157;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  width: var(--dl-w);
  height: var(--dl-h);
  overflow: hidden;
  border: 1px solid rgba(31, 23, 26, 0.1);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: #fff;
  box-shadow: 0 30px 70px -20px rgba(31, 23, 26, 0.38);
  visibility: hidden;
  transform: translateY(-101%);
  transition: transform 0.38s var(--dl-ease), visibility 0.38s;
}

.sb-dl.is-open .sb-dl-sheet {
  visibility: visible;
  transform: none;
}

.sb-dl-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px 14px;
  border-right: 1px solid rgba(31, 23, 26, 0.07);
  background: #faf7f6;
}

.sb-dl-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #1f171a;
  font-family: var(--_font-default);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.sb-dl-platform:hover {
  background: rgba(31, 23, 26, 0.045);
}

.sb-dl-platform.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(31, 23, 26, 0.08), 0 4px 12px -4px rgba(31, 23, 26, 0.14);
}

.sb-dl-platform__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: var(--pf, #1f171a);
  box-shadow: inset 0 0 0 1px rgba(31, 23, 26, 0.1);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sb-dl-platform__icon--mac { --pf: #111; }
.sb-dl-platform__icon--windows { --pf: #0067c0; }
.sb-dl-platform__icon--mobile { --pf: var(--sb-berry-500, #d91548); }
.sb-dl-platform__icon--chrome { --pf: #1a73e8; }

.sb-dl-platform.is-active .sb-dl-platform__icon {
  background: var(--pf);
  color: #fff;
  box-shadow: none;
}

.sb-dl-platform__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sb-dl-platform__copy strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.sb-dl-platform__copy span {
  color: #7a6d71;
  font-size: 12px;
  line-height: 1.25;
}

.sb-dl-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 10px;
  color: var(--sb-berry-600, #b8103d);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.sb-dl-all:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* All panels share one grid cell, so the sheet never changes height between tabs. */
.sb-dl-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.sb-dl-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 28px;
  min-height: 0;
  padding: 30px 30px 30px 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.24s ease, transform 0.32s var(--dl-ease), visibility 0.24s;
}

.sb-dl-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sb-dl-title {
  margin: 0 0 10px;
  color: #1f171a;
  font-family: var(--_font-accent);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.sb-dl-sub {
  margin: 0 0 20px;
  color: #675b5f;
  font-size: 14px;
  line-height: 1.5;
}

.sb-dl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.sb-dl-actions .sb-nav-btn {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
}

.sb-dl-textlink {
  color: #675b5f;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: rgba(103, 91, 95, 0.4);
  text-underline-offset: 3px;
}

.sb-dl-textlink:hover {
  color: #1f171a;
}

.sb-dl-store {
  display: block;
  border-radius: 8px;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.sb-dl-store:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.sb-dl-store img {
  display: block;
  width: auto;
  height: 42px;
}

.sb-dl-extra {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 11px 12px;
  border: 1px solid rgba(31, 23, 26, 0.09);
  border-radius: 14px;
  color: #1f171a;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.sb-dl-extra:hover {
  border-color: rgba(31, 23, 26, 0.16);
  background: #faf7f6;
}

.sb-dl-extra__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e8f0fe;
  color: #1a73e8;
}

.sb-dl-extra__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sb-dl-extra__copy strong {
  font-size: 13.5px;
  font-weight: 600;
}

.sb-dl-extra__copy span {
  color: #7a6d71;
  font-size: 12px;
}

.sb-dl-extra > svg {
  color: #85777c;
  transition: transform 0.16s ease;
}

.sb-dl-extra:hover > svg {
  transform: translateX(2px);
}

.sb-dl-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #f3eeec;
  box-shadow: 0 0 0 1px rgba(31, 23, 26, 0.08), 0 18px 36px -14px rgba(31, 23, 26, 0.3);
}

.sb-dl-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sb-dl-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 23, 26, 0.05);
  color: #675b5f;
  cursor: pointer;
}

.sb-dl-close:hover {
  background: rgba(31, 23, 26, 0.1);
  color: #1f171a;
}

@media (min-width: 768px) {
  .sb-dl { --dl-nav: 62px; }
}

@media (min-width: 1024px) {
  .sb-dl { --dl-nav: 64px; }
}

/* Tablet: clip above the copy, sized so every tab fits the same height */
@media (max-width: 899px) {
  .sb-dl {
    --dl-h: 548px;
  }
  .sb-dl-sheet {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sb-dl-panel {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 20px;
    padding: 24px 56px 24px 26px;
  }
  .sb-dl-media {
    order: -1;
    width: min(100%, 352px);
  }
  .sb-dl-title {
    font-size: 24px;
  }
}

/* Phone: tabs across the top, clip above the copy */
@media (max-width: 639px) {
  .sb-dl {
    --dl-right: 8px;
    --dl-w: calc(100vw - 16px);
    --dl-h: min(560px, calc(100dvh - var(--dl-top) - 52px));
  }
  .sb-dl-tab {
    right: 20px;
    height: 34px;
    font-size: 12.5px;
  }
  .sb-dl-sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 0 0 20px 20px;
  }
  .sb-dl-tabs {
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(31, 23, 26, 0.07);
  }
  .sb-dl-platform {
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 8px 2px 7px;
    text-align: center;
  }
  .sb-dl-platform__icon {
    width: 32px;
    height: 32px;
  }
  .sb-dl-platform__copy strong {
    font-size: 12.5px;
  }
  .sb-dl-platform__copy span,
  .sb-dl-all,
  .sb-dl-close {
    display: none;
  }
  .sb-dl-panel {
    align-content: start;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
  }
  .sb-dl-platform {
    font-size: 12.5px;
  }
  .sb-dl-media {
    width: 100%;
  }
  .sb-dl-title {
    font-size: 22px;
  }
  .sb-dl-sub {
    margin-bottom: 16px;
    font-size: 13.5px;
  }
  .sb-dl-extra {
    margin-top: 16px;
  }
  .sb-dl-store img {
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-dl-tab,
  .sb-dl-tab__icon,
  .sb-dl-sheet,
  .sb-dl-panel,
  .sb-dl-backdrop {
    transition: none;
    animation: none;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   - Mobile:  < 768px  (Berry + Scribeberry, Search, Open App, Menu)
   - Tablet:  768px–1023px (+ Try It Now pill, clean 58px height)
   - Desktop: >= 1024px (Full 5-item inline nav, no burger)
   ========================================================================== */
@media (max-width: 639px) {
  .site-header__menu-ctas {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 399px) {
  .site-header__wordmark {
    font-size: 20px;
  }
  .site-header__logo {
    width: 30px;
    height: 30px;
  }
  .site-header__inner {
    padding: 0 12px;
    gap: 8px;
  }
  .site-header__actions {
    gap: 6px;
  }
}

@media (min-width: 768px) {
  .site-header {
    --sb-nav-height: 62px;
  }
  .site-header__inner {
    padding: 0 28px;
  }
  .site-header .header-try-btn {
    display: inline-flex;
  }
  .site-header .header-open-app {
    height: 38px;
    padding: 0 15px;
    font-size: 13.5px;
  }
  .site-header__menu-top {
    height: 62px;
    padding: 0 28px;
  }
  .site-header__menu-search-wrap {
    padding: 16px 28px 4px;
  }
  .site-header__menu-body {
    padding: 8px 28px 28px;
  }
  .site-header__menu-footer {
    padding: 16px 28px 20px;
  }
}

@media (min-width: 1024px) {
  .site-header {
    --sb-nav-height: 64px;
  }
  .site-header__inner {
    padding: 0 24px;
    gap: 12px;
  }
  .header-nav__list {
    gap: 0;
  }
  .header-nav__trigger,
  .header-nav__item > .header-nav__link {
    padding: 0 8px;
    font-size: 13.5px;
  }
  .site-header__burger {
    display: none;
  }
  .site-header .header-nav {
    display: flex;
  }
}

@media (min-width: 1280px) {
  .site-header__inner {
    padding: 0 56px;
    gap: 16px;
  }
  .header-nav__trigger,
  .header-nav__item > .header-nav__link {
    padding: 0 13px;
    font-size: 14.5px;
  }
  .header-nav__list {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .header-nav__chevron,
  .header-nav__panel {
    transition: none;
    animation: none;
  }
}
