.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

:root {
  --brand-accent: #69983b;
  --pill-chevron-inset: 19px;
  --pill-chevron-size: 8px;
  --pill-chevron-stroke: 2px;
}

.brand-logo {
  display: block;
  width: clamp(148px, 15vw, 176px);
  height: auto;
  max-width: 100%;
}

footer .brand-logo {
  width: clamp(142px, 14vw, 160px);
}

.frontend-brand-group {
  min-width: 0;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.frontend-admin-badge {
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #75a443;
  border-radius: 999px;
  color: #123f33;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .18em;
  line-height: 1;
  text-decoration: none;
}

.nav-links > a,
.site-header > nav > a:not(.sell):not(.account-cta) {
  color: #215845;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

@media (max-width: 680px) {
  .nav-links > a,
  .site-header > nav > a:not(.sell):not(.account-cta) {
    font-size: 11px;
  }
}

@media (max-width: 619px) {
  .nav,
  header.site-header {
    padding-right: 10px;
    padding-left: 10px;
    column-gap: 6px;
  }

  header.site-header {
    height: auto;
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 10px;
    align-content: center;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  header.site-header > nav {
    min-width: 0;
    flex: 0 0 auto;
    flex-basis: auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 5px;
  }

  .nav .frontend-brand-group,
  header .frontend-brand-group {
    gap: 7px;
  }

  .nav .frontend-brand-group .brand-logo,
  header .frontend-brand-group .brand-logo {
    width: 118px;
  }

  .nav .frontend-admin-badge,
  header .frontend-admin-badge {
    min-height: 30px;
    padding: 0 9px;
    font-size: 9px;
  }

  .nav-actions {
    min-width: 0;
    gap: 5px;
  }

  .nav-actions .connection,
  header.site-header > nav > .connection {
    min-height: 38px;
    max-width: 100px;
    padding: 7px 9px;
    gap: 6px;
    overflow: hidden;
    font-size: 10px;
  }

  .nav-actions .connection {
    flex: 0 1 100px;
  }

  .connection > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-actions .account-cta,
  header.site-header > nav > .account-cta,
  header.site-header > nav > .sell {
    min-height: 38px;
    height: auto;
    padding: 7px 10px;
    gap: 5px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .nav-actions .account-cta #account-cta-label,
  .nav-actions .account-cta span[aria-hidden="true"],
  header.site-header > nav > .account-cta span {
    font-size: inherit;
  }
}

@media (max-width: 420px) {
  footer .brand-logo {
    width: 136px;
  }
}

/*
 * Shared frontend width contract.
 *
 * Full-bleed surfaces keep their background and borders, while their direct
 * content follows the same inset as every .page-width container. Keeping the
 * maximum and responsive gutters here prevents individual entrypoints from
 * drifting back to page-specific 1160/1360/1440px shells.
 */
:root {
  --frontend-content-max: 1380px;
  --frontend-page-gutter: 16px;
  --frontend-page-gutters: 32px;
  --frontend-content-inset: max(
    var(--frontend-page-gutter),
    calc((100% - var(--frontend-content-max)) / 2)
  );
}

.page-width,
.page,
.detail-page {
  width: min(
    var(--frontend-content-max),
    calc(100% - var(--frontend-page-gutters))
  );
  max-width: var(--frontend-content-max);
  margin-inline: auto;
}

/* These sections historically implemented their gutters as inner padding. */
.hero.page-width,
.results.page-width,
.story.page-width {
  padding-right: 0;
  padding-left: 0;
}

/* Full-width chrome uses the same content edges without shrinking its band. */
.nav,
header.site-header,
.topbar,
footer {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  padding-right: var(--frontend-content-inset);
  padding-left: var(--frontend-content-inset);
}

@media (min-width: 520px) {
  :root {
    --frontend-page-gutter: 28px;
    --frontend-page-gutters: 56px;
  }
}

@media (min-width: 820px) {
  :root {
    --frontend-page-gutter: 40px;
    --frontend-page-gutters: 80px;
  }
}
