/* Per-feature metadata row (rendered under each feature heading) */
.md-typeset .feature-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.15em;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--md-default-fg-color--light);
  margin: -0.25em 0 0.9em;
  padding: 0.25em 0.5em;
  border-left: 2px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color, rgba(0, 0, 0, 0.03));
  border-radius: 0 0.2em 0.2em 0;
  letter-spacing: 0.01em;
}
.md-typeset .feature-meta__label {
  text-transform: uppercase;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--md-default-fg-color--light);
  opacity: 0.75;
  margin-right: 0.25em;
  cursor: help;
}
.md-typeset .feature-meta__item {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
}
.md-typeset .feature-meta__item--issues {
  flex: 1 1 14rem;
  flex-wrap: wrap;
  white-space: normal;
}
.md-typeset .feature-meta__sep {
  flex: 0 0 auto;
  opacity: 0.5;
  margin: 0 0.15em;
}
.md-typeset .feature-meta__issues {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 0.45em;
  min-width: 0;
}
.md-typeset .feature-meta__issue {
  display: inline-block;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

/* Feature recording thumbnails and lightbox */
.md-typeset .bp-feature-media {
  margin: 0.75rem 0 1.1rem;
}

.md-typeset .bp-feature-media__trigger {
  display: block;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.3rem;
  background: var(--md-code-bg-color, rgba(0, 0, 0, 0.03));
  box-shadow: 0 0.08rem 0.28rem rgba(0, 0, 0, 0.08);
}

.md-typeset .bp-feature-media__trigger:focus-visible {
  outline: 0.12rem solid var(--md-accent-fg-color);
  outline-offset: 0.12rem;
}

.md-typeset .bp-feature-media__trigger img,
.md-typeset .bp-feature-media__trigger video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.md-typeset .bp-feature-media figcaption {
  margin-top: 0.35rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.72rem;
  line-height: 1.45;
}

.bp-lightbox[hidden] {
  display: none;
}

.bp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.bp-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 20, 0.78);
  cursor: zoom-out;
}

.bp-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(96vw, 78rem);
  max-width: min(96vw, 78rem);
  max-height: min(92vh, 54rem);
  color: var(--md-default-fg-color);
}

.bp-lightbox__media {
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-lightbox__media img,
.bp-lightbox__media video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: calc(92vh - 4rem);
  object-fit: contain;
  border-radius: 0.3rem;
  background: #000;
  box-shadow: 0 0.4rem 1.8rem rgba(0, 0, 0, 0.35);
}

.bp-lightbox__caption {
  justify-self: center;
  max-width: min(90vw, 54rem);
  margin-top: 0.55rem;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.bp-lightbox__close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.bp-lightbox__close:focus-visible {
  outline: 0.12rem solid #fff;
  outline-offset: 0.12rem;
}

.bp-lightbox-open {
  overflow: hidden;
}

/* OS-specific keyboard shortcuts */
.md-typeset .bp-shortcut {
  white-space: nowrap;
}

/* Maturity badges */
.md-typeset .badge-stable {
  background-color: #4caf50;
  color: #fff;
  padding: 0.1em 0.5em;
  border-radius: 0.25em;
  font-size: 0.75em;
  font-weight: 700;
  vertical-align: middle;
}

.md-typeset .badge-incubating {
  background-color: #ff9800;
  color: #fff;
  padding: 0.1em 0.5em;
  border-radius: 0.25em;
  font-size: 0.75em;
  font-weight: 700;
  vertical-align: middle;
}

.md-typeset .badge-deprecated {
  background-color: #f44336;
  color: #fff;
  padding: 0.1em 0.5em;
  border-radius: 0.25em;
  font-size: 0.75em;
  font-weight: 700;
  vertical-align: middle;
}

/* Feature cards on landing page */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-grid .card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1rem;
}

.feature-grid .card h3 {
  margin-top: 0;
}

/* Persistent Marketplace CTA in the docs header */
.bp-header-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 1.75rem;
  margin-left: 0.4rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--md-default-fg-color);
  border-radius: 0.2rem;
  background: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0.05rem 0.2rem var(--md-default-fg-color--lightest);
}

.bp-header-install:hover {
  color: var(--md-default-bg-color);
  opacity: 0.82;
}

.bp-header-install__short {
  display: none;
}

@media screen and (max-width: 44.9375em) {
  .bp-header-install {
    margin-left: 0.2rem;
    padding-inline: 0.45rem;
  }

  .bp-header-install__label {
    display: none;
  }

  .bp-header-install__short {
    display: inline;
  }
}

/* BetterPy landing page */
.md-main__inner:has(.bp-hero) {
  max-width: none;
  margin: 0;
}

.md-content:has(.bp-hero) {
  min-width: 0;
}

.md-content:has(.bp-hero) > .md-content__inner {
  margin: 0;
  padding: 0;
}

.md-content:has(.bp-hero) > .md-content__inner::before {
  display: none;
}

.md-content__inner:has(.bp-hero) {
  --bp-ink: #16181d;
  --bp-muted: #5b616e;
  --bp-paper: #ffffff;
  --bp-soft: #f3f5f7;
  --bp-line: #d9dee5;
  --bp-blue: #306998;
  --bp-blue-bright: #4c9bd3;
  --bp-yellow: #ffd43b;
  --bp-green: #2f9e72;
  width: 100%;
  color: var(--bp-ink);
  background: var(--bp-paper);
}

[data-md-color-scheme="slate"] .md-content__inner:has(.bp-hero) {
  --bp-ink: #f4f6f8;
  --bp-muted: #b2b8c2;
  --bp-paper: #17191e;
  --bp-soft: #22252c;
  --bp-line: #353a44;
}

.md-content__inner:has(.bp-hero) h1,
.md-content__inner:has(.bp-hero) h2,
.md-content__inner:has(.bp-hero) h3,
.md-content__inner:has(.bp-hero) p,
.md-content__inner:has(.bp-hero) dl,
.md-content__inner:has(.bp-hero) ol,
.md-content__inner:has(.bp-hero) ul {
  letter-spacing: 0;
}

.md-content__inner:has(.bp-hero) h1,
.md-content__inner:has(.bp-hero) h2,
.md-content__inner:has(.bp-hero) h3 {
  color: inherit;
  font-weight: 750;
}

.md-content__inner:has(.bp-hero) a {
  color: inherit;
}

.bp-hero {
  position: relative;
  min-height: 34rem;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  color: #fff;
  background-color: #22252b;
  background-image: url("../assets/features/structure-view-overload-hiding/hide-overloads.gif");
  background-repeat: no-repeat;
  background-position: center right;
  background-size: auto 100%;
}

.bp-hero::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 60%;
  content: "";
  background: rgba(25, 27, 32, 0.95);
}

.bp-hero__content {
  position: relative;
  z-index: 1;
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: 4rem 2.4rem 3.2rem;
}

.bp-hero__brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  color: #d8dce2;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.bp-hero__brand img {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
}

.md-content__inner:has(.bp-hero) .bp-hero h1 {
  margin: 0 0 0.35rem;
  color: var(--bp-yellow);
  font-size: 1.2rem;
  line-height: 1.2;
}

.bp-hero__headline {
  max-width: 31rem;
  margin: 0;
  color: #fff;
  font-size: 2.8rem;
  font-weight: 780;
  line-height: 1.04;
}

.bp-hero__copy {
  max-width: 29rem;
  margin: 1.2rem 0 0;
  color: #d7dbe2;
  font-size: 1rem;
  line-height: 1.65;
}

.bp-hero__actions,
.bp-final__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.65rem;
}

.bp-button {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-size: 0.77rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.bp-button:hover {
  text-decoration: none;
}

.bp-button--primary {
  border-color: var(--bp-yellow);
  background: var(--bp-yellow);
  color: #16181d !important;
}

.bp-button--primary:hover {
  border-color: #ffe36f;
  background: #ffe36f;
}

.bp-button--secondary {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(22, 24, 29, 0.78);
  color: #fff !important;
}

.bp-button--secondary:hover {
  border-color: #fff;
  background: #22252b;
}

.bp-button--dark {
  border-color: var(--bp-ink);
  background: var(--bp-ink);
  color: var(--bp-paper) !important;
}

.bp-button--dark:hover {
  opacity: 0.86;
}

.bp-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 8rem));
  gap: 1.2rem;
  max-width: 29rem;
  margin: 2.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.bp-hero__stats div {
  min-width: 0;
}

.bp-hero__stats dt {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.3;
}

.bp-hero__stats dd {
  margin: 0.25rem 0 0;
  color: #aeb4be;
  font-size: 0.64rem;
  line-height: 1.35;
}

.bp-band {
  width: 100%;
  background: var(--bp-paper);
}

.bp-band__inner {
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: 4.2rem 2.4rem;
}

.bp-kicker {
  margin: 0 0 0.6rem !important;
  color: var(--bp-blue);
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

[data-md-color-scheme="slate"] .bp-kicker {
  color: var(--bp-blue-bright);
}

.md-content__inner:has(.bp-hero) .bp-band h2 {
  max-width: 34rem;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

.bp-intro {
  border-bottom: 1px solid var(--bp-line);
}

.bp-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 2.8rem;
}

.bp-pillars article {
  min-width: 0;
  padding: 0 2rem;
  border-left: 1px solid var(--bp-line);
}

.bp-pillars article:first-child {
  padding-left: 0;
  border-left: 0;
}

.bp-pillars article:last-child {
  padding-right: 0;
}

.bp-pillar__index {
  display: block;
  margin-bottom: 1rem;
  color: var(--bp-green);
  font-family: var(--md-code-font-family);
  font-size: 0.7rem;
  font-weight: 700;
}

.md-content__inner:has(.bp-hero) .bp-pillars h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.bp-pillars p {
  margin: 0.65rem 0 0;
  color: var(--bp-muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.bp-features {
  background: var(--bp-soft);
}

.bp-features .bp-band__inner {
  padding-bottom: 0;
}

.bp-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.bp-section-heading > a {
  flex: 0 0 auto;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  color: var(--bp-blue);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

[data-md-color-scheme="slate"] .bp-section-heading > a {
  color: var(--bp-blue-bright);
}

.md-content__inner:has(.bp-hero) .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: 2.4rem 2.4rem 4.2rem;
  background: var(--bp-soft);
  box-shadow: 0 0 0 100vmax var(--bp-soft);
  clip-path: inset(0 -100vmax);
}

.md-content__inner:has(.bp-hero) .feature-grid .card {
  min-width: 0;
  min-height: 13.5rem;
  padding: 1.25rem;
  border: 1px solid var(--bp-line);
  border-radius: 0.35rem;
  background: var(--bp-paper);
}

.md-content__inner:has(.bp-hero) .feature-grid .card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.md-content__inner:has(.bp-hero) .feature-grid .card p {
  margin: 0.75rem 0 0;
  color: var(--bp-muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.md-content__inner:has(.bp-hero) .feature-grid .card p:last-child {
  margin-top: 1rem;
}

.md-content__inner:has(.bp-hero) .feature-grid .card a {
  color: var(--bp-blue);
  font-weight: 700;
  text-decoration: none;
}

[data-md-color-scheme="slate"] .md-content__inner:has(.bp-hero) .feature-grid .card a {
  color: var(--bp-blue-bright);
}

.bp-start {
  border-top: 1px solid var(--bp-line);
}

.bp-start .bp-band__inner {
  display: grid;
  grid-template-columns: minmax(15rem, 0.75fr) minmax(20rem, 1.25fr);
  gap: 4rem;
  align-items: start;
}

.bp-start__lead .bp-button {
  margin-top: 1.5rem;
}

.bp-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-steps li {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--bp-line);
}

.bp-steps li:first-child {
  padding-top: 0;
}

.bp-steps > li > span {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid var(--bp-line);
  border-radius: 50%;
  color: var(--bp-blue);
  font-family: var(--md-code-font-family);
  font-size: 0.72rem;
  font-weight: 800;
}

.bp-steps strong {
  display: block;
  font-size: 0.83rem;
}

.bp-steps p {
  margin: 0.3rem 0 0;
  color: var(--bp-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.bp-final {
  color: #fff;
  background: var(--bp-blue);
  border-top: 0.35rem solid var(--bp-yellow);
}

.bp-final .bp-band__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.bp-final .bp-kicker {
  color: #dbeefa;
}

.md-content__inner:has(.bp-hero) .bp-final h2 {
  color: #fff;
}

.bp-final__actions {
  flex: 0 0 auto;
  margin-top: 0;
}

@media screen and (max-width: 76rem) {
  .bp-hero::before {
    width: 67%;
  }
}

@media screen and (max-width: 52rem) {
  .bp-hero {
    display: block;
    min-height: 0;
    padding-bottom: 12rem;
    background-color: #191b20;
    background-image: none;
  }

  .bp-hero::before {
    z-index: 0;
    inset: 0;
    width: 100%;
    height: auto;
    background: #191b20;
  }

  .bp-hero::after {
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    height: 12rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background-color: #22252b;
    background-image: url("../assets/features/structure-view-overload-hiding/hide-overloads.gif");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    content: "";
  }

  .bp-hero__content {
    z-index: 2;
    padding-top: 2.7rem;
    padding-bottom: 2.2rem;
  }

  .bp-hero__headline {
    font-size: 2.25rem;
  }

  .bp-hero__copy {
    max-width: 36rem;
  }

  .bp-hero__stats {
    max-width: none;
  }

  .md-content__inner:has(.bp-hero) .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-start .bp-band__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .bp-final .bp-band__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media screen and (max-width: 39rem) {
  .bp-hero {
    min-height: 0;
    padding-bottom: 10.5rem;
  }

  .bp-hero::before {
    height: auto;
  }

  .bp-hero::after {
    height: 10.5rem;
  }

  .bp-hero__content,
  .bp-band__inner,
  .md-content__inner:has(.bp-hero) .feature-grid {
    padding-right: 1.15rem;
    padding-left: 1.15rem;
  }

  .bp-hero__headline {
    font-size: 1.95rem;
  }

  .bp-hero__copy {
    font-size: 0.83rem;
  }

  .bp-hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1.5rem;
  }

  .bp-hero__actions {
    gap: 0.5rem;
    margin-top: 1.25rem;
  }

  .bp-hero__actions .bp-button,
  .bp-final__actions .bp-button {
    width: 100%;
  }

  .bp-hero__actions .bp-button {
    min-height: 2.5rem;
    padding-block: 0.55rem;
    font-size: 0.72rem;
  }

  .bp-band__inner {
    padding-top: 3.2rem;
    padding-bottom: 3.2rem;
  }

  .md-content__inner:has(.bp-hero) .bp-band h2 {
    font-size: 1.5rem;
  }

  .bp-pillars {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .bp-pillars article,
  .bp-pillars article:first-child,
  .bp-pillars article:last-child {
    padding: 0 0 0 1rem;
    border-left: 1px solid var(--bp-line);
  }

  .bp-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .md-content__inner:has(.bp-hero) .feature-grid {
    grid-template-columns: 1fr;
  }

  .md-content__inner:has(.bp-hero) .feature-grid .card {
    min-height: 0;
  }

  .bp-final__actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-hero {
    background-image: url("../assets/features/structure-view-overload-hiding/hide-overloads.gif");
  }
}
