:root {
  --molcrafts-forest: #18432b;
  --molcrafts-forest-light: #2a6744;
  --molcrafts-forest-dark: #0e2b1b;
  --molcrafts-cream: #fbf6e4;
  --molcrafts-cream-soft: #fffaf0;
  --molcrafts-sand: #f2da9d;
  --molcrafts-sand-strong: #c8841d;
  --molcrafts-ink: #14271d;
  --molcrafts-muted: #657268;
  /* Print-manual radius: tight corners, never blob-y SaaS. */
  --molcrafts-radius-sm: 0.28rem;
  --molcrafts-radius: 0.4rem;
  --molcrafts-radius-lg: 0.55rem;
  --molcrafts-shadow-sm: 0 0.08rem 0.28rem rgba(24, 67, 43, 0.05);
  --molcrafts-shadow: 0 0.35rem 0.95rem rgba(24, 67, 43, 0.08);
  --molcrafts-shadow-lg: 0 0.65rem 1.55rem rgba(24, 67, 43, 0.11);
  --molcrafts-rule: color-mix(in srgb, var(--md-primary-fg-color) 14%, transparent);
  --molcrafts-rule-strong: color-mix(in srgb, var(--md-primary-fg-color) 22%, transparent);
  --molcrafts-paper: color-mix(in srgb, var(--md-default-bg-color) 88%, #fff);
  --molcrafts-paper-elevated: color-mix(in srgb, var(--md-default-bg-color) 72%, #fff);
  --molcrafts-focus-ring: 0 0 0 2px var(--md-default-bg-color), 0 0 0 4px var(--molcrafts-product-accent);
}

/*
 * Per-product accent colours are NOT defined here. Each product declares its own
 * primary (主) and secondary (副) accent in its own zensical.toml:
 *
 *   [project.extra.molcrafts]
 *   product = "molpy"
 *   accent = "#0284c7"
 *   accent_soft = "rgba(2, 132, 199, 0.14)"
 *
 * main.html reads those two values and injects them as
 * --molcrafts-product-accent / --molcrafts-product-accent-soft. This theme owns
 * only the common palette below; the default accent (brand forest/sand) applies
 * to any product that does not set its own.
 *
 * Colours the map previously assigned, for reference when wiring each product's
 * config: molvis #7c3aed, molnex/molcfg #0f766e, molrec #c2410c,
 * molexp/molmcp #4f46e5, mollog #0ea5e9, molq/molqrc #db2777.
 */

/*
 * Use Zensical's standard scheme names so all of its light/dark component
 * semantics apply automatically. The legacy names remain supported for pages
 * with a palette choice cached before this theme switched to default/slate.
 */
:is([data-md-color-scheme="default"], [data-md-color-scheme="molcrafts"]) {
  --molcrafts-product-accent: var(--molcrafts-forest);
  --molcrafts-product-accent-soft: rgba(24, 67, 43, 0.12);
  --molcrafts-paper: #fffdf6;
  --molcrafts-paper-elevated: #fffaf0;
  --molcrafts-shadow-sm: 0 0.08rem 0.28rem rgba(24, 67, 43, 0.05);
  --molcrafts-shadow: 0 0.35rem 0.95rem rgba(24, 67, 43, 0.08);
  --molcrafts-shadow-lg: 0 0.65rem 1.55rem rgba(24, 67, 43, 0.11);
  --md-default-fg-color: rgba(20, 39, 29, 0.92);
  --md-default-fg-color--light: rgba(20, 39, 29, 0.7);
  --md-default-fg-color--lighter: rgba(20, 39, 29, 0.48);
  --md-default-fg-color--lightest: rgba(20, 39, 29, 0.16);
  --md-default-bg-color: var(--molcrafts-cream);
  --md-default-bg-color--light: rgba(251, 246, 228, 0.72);
  --md-default-bg-color--lighter: rgba(251, 246, 228, 0.36);
  --md-default-bg-color--lightest: rgba(251, 246, 228, 0.16);
  --md-primary-fg-color: var(--molcrafts-forest);
  --md-primary-fg-color--light: var(--molcrafts-forest-light);
  --md-primary-fg-color--dark: var(--molcrafts-forest-dark);
  --md-primary-bg-color: var(--molcrafts-cream);
  --md-accent-fg-color: var(--molcrafts-sand-strong);
  --md-accent-fg-color--transparent: rgba(200, 132, 29, 0.16);
  --md-accent-bg-color: var(--molcrafts-ink);
  --md-code-fg-color: #264136;
  --md-code-bg-color: #f3e9cb;
  --md-code-bg-color--light: rgba(243, 233, 203, 0.9);
  --md-code-bg-color--lighter: rgba(243, 233, 203, 0.54);
  --md-code-hl-color: rgba(242, 218, 157, 0.45);
  --md-code-hl-number-color: #a15c09;
  --md-code-hl-special-color: #0f766e;
  --md-code-hl-function-color: #1d5f3a;
  --md-code-hl-constant-color: #7c3aed;
  --md-code-hl-keyword-color: #0b7285;
  --md-code-hl-string-color: #2f7d46;
  --md-code-hl-name-color: var(--molcrafts-ink);
  --md-code-hl-operator-color: #4b6356;
  --md-code-hl-punctuation-color: #4b6356;
  --md-code-hl-comment-color: #7b857c;
  --md-code-hl-generic-color: #4b6356;
  --md-code-hl-variable-color: #8a5a14;
  --md-typeset-a-color: #1f6b43;
  --md-typeset-color: var(--md-default-fg-color);
  --md-typeset-mark-color: rgba(242, 218, 157, 0.5);
  --md-typeset-table-color: rgba(24, 67, 43, 0.14);
  --md-typeset-table-color--light: rgba(24, 67, 43, 0.035);
  --md-typeset-kbd-color: #fffaf0;
  --md-typeset-kbd-accent-color: #ead39a;
  --md-typeset-kbd-border-color: #d4bb7c;
  --md-admonition-fg-color: var(--molcrafts-ink);
  --md-admonition-bg-color: #fffaf0;
  --md-footer-bg-color: #153923;
  --md-footer-bg-color--dark: #102c1b;
  --md-footer-fg-color: rgba(251, 246, 228, 0.92);
  --md-footer-fg-color--light: rgba(251, 246, 228, 0.72);
  --md-footer-fg-color--lighter: rgba(251, 246, 228, 0.46);
  color-scheme: light;
}

:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) {
  --md-hue: 148;
  --molcrafts-product-accent: var(--molcrafts-sand);
  --molcrafts-product-accent-soft: rgba(242, 218, 157, 0.14);
  --molcrafts-paper: #141c15;
  --molcrafts-paper-elevated: #182119;
  --molcrafts-shadow-sm: 0 0.08rem 0.28rem rgba(0, 0, 0, 0.22);
  --molcrafts-shadow: 0 0.4rem 1.05rem rgba(0, 0, 0, 0.28);
  --molcrafts-shadow-lg: 0 0.75rem 1.7rem rgba(0, 0, 0, 0.34);
  --molcrafts-rule: color-mix(in srgb, var(--md-default-fg-color) 12%, transparent);
  --molcrafts-rule-strong: color-mix(in srgb, var(--md-default-fg-color) 18%, transparent);
  --md-default-fg-color: rgba(236, 242, 232, 0.9);
  --md-default-fg-color--light: rgba(236, 242, 232, 0.68);
  --md-default-fg-color--lighter: rgba(236, 242, 232, 0.46);
  --md-default-fg-color--lightest: rgba(236, 242, 232, 0.14);
  --md-default-bg-color: #101811;
  --md-default-bg-color--light: rgba(16, 24, 17, 0.76);
  --md-default-bg-color--lighter: rgba(16, 24, 17, 0.44);
  --md-default-bg-color--lightest: rgba(16, 24, 17, 0.18);
  --md-primary-fg-color: #2f7d50;
  --md-primary-fg-color--light: #55a572;
  --md-primary-fg-color--dark: #173d26;
  --md-primary-bg-color: #fbf6e4;
  --md-accent-fg-color: #f2da9d;
  --md-accent-fg-color--transparent: rgba(242, 218, 157, 0.16);
  --md-accent-bg-color: #101811;
  --md-code-fg-color: #d8e2d8;
  --md-code-bg-color: #14251a;
  --md-code-bg-color--light: rgba(20, 37, 26, 0.9);
  --md-code-bg-color--lighter: rgba(20, 37, 26, 0.54);
  --md-code-hl-color: rgba(242, 218, 157, 0.18);
  --md-code-hl-number-color: #f2c27c;
  --md-code-hl-special-color: #7dd3c7;
  --md-code-hl-function-color: #8ecfa0;
  --md-code-hl-constant-color: #c4b5fd;
  --md-code-hl-keyword-color: #8bd0e8;
  --md-code-hl-string-color: #a6d98a;
  --md-code-hl-name-color: #eef5ec;
  --md-code-hl-operator-color: #9ead9f;
  --md-code-hl-punctuation-color: #9ead9f;
  --md-code-hl-comment-color: #7b8b7c;
  --md-code-hl-generic-color: #9ead9f;
  --md-code-hl-variable-color: #f2da9d;
  --md-typeset-a-color: #8ecfa0;
  --md-typeset-color: var(--md-default-fg-color);
  --md-typeset-mark-color: rgba(242, 218, 157, 0.22);
  --md-typeset-table-color: rgba(236, 242, 232, 0.14);
  --md-typeset-table-color--light: rgba(236, 242, 232, 0.035);
  --md-typeset-kbd-color: #17271d;
  --md-typeset-kbd-accent-color: #284733;
  --md-typeset-kbd-border-color: #355c41;
  --md-admonition-fg-color: #ecf2e8;
  --md-admonition-bg-color: #142117;
  --md-footer-bg-color: #0d2114;
  --md-footer-bg-color--dark: #09170e;
  --md-footer-fg-color: rgba(251, 246, 228, 0.92);
  --md-footer-fg-color--light: rgba(251, 246, 228, 0.72);
  --md-footer-fg-color--lighter: rgba(251, 246, 228, 0.46);
  --md-shadow-z1: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.12), 0 0 0.05rem rgba(255, 255, 255, 0.1);
  --md-shadow-z2: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.25), 0 0 0.05rem rgba(255, 255, 255, 0.22);
  --md-shadow-z3: 0 0.5rem 2rem rgba(0, 0, 0, 0.4), 0 0 0.05rem rgba(0, 0, 0, 0.35);
  --color-foreground: 236 242 232;
  --color-background: 16 24 17;
  --color-background-subtle: 20 33 23;
  --color-backdrop: 9 15 10;
  color-scheme: dark;
}

:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .md-header__title,
:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) :is(h1, h2, h3, h4, h5, h6) {
  color: #f4f8f2;
}

:is([data-md-color-scheme="default"], [data-md-color-scheme="molcrafts"]) img:is([src$="#gh-dark-mode-only"], [src$="#only-dark"]),
:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) img:is([src$="#gh-light-mode-only"], [src$="#only-light"]) {
  display: none;
}

.md-header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 55%),
    linear-gradient(90deg, var(--molcrafts-forest-dark), var(--molcrafts-forest) 62%, var(--molcrafts-forest-light));
  color: var(--molcrafts-cream);
  box-shadow: 0 0.12rem 0.45rem rgba(14, 43, 27, 0.16);
  border-bottom: 1px solid rgba(14, 43, 27, 0.35);
}

.md-header__button.md-logo {
  margin: 0.2rem 0.25rem 0.2rem 0;
  padding: 0.18rem;
}

.md-header__button.md-logo img,
.md-nav__button.md-logo img {
  height: 1.55rem;
  padding: 0.1rem;
  background: var(--molcrafts-cream);
  border-radius: var(--molcrafts-radius-sm);
  box-shadow: inset 0 0 0 1px rgba(24, 67, 43, 0.08);
}

.md-header__topic,
.md-tabs__link,
.md-nav__title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.md-tabs {
  background: color-mix(in srgb, var(--md-default-bg-color) 94%, var(--md-primary-fg-color));
  border-bottom: 1px solid var(--molcrafts-rule-strong);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
}

:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .md-tabs {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.md-tabs__link {
  opacity: 0.72;
  letter-spacing: 0.02em;
}

.md-tabs__link--active,
.md-tabs__link:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
  opacity: 1;
}

.md-tabs__link:focus-visible {
  outline: none;
  box-shadow: var(--molcrafts-focus-ring);
  border-radius: var(--molcrafts-radius-sm);
}

.md-main__inner {
  margin-top: 1.15rem;
}

.md-grid {
  max-width: 1320px;
}

/* Shared keyboard focus for interactive theme chrome. */
.molcrafts-home-hero__button:focus-visible,
.molcrafts-home-hero__install-tab:focus-visible,
.molcrafts-home-hero__install-copy:focus-visible,
.md-typeset .molcrafts-manual-index a:focus-visible,
.md-typeset .molcrafts-manual-grid > a:focus-visible,
.md-typeset .molcrafts-manual-list > a:focus-visible,
.md-typeset .md-button:focus-visible,
.md-nav__link:focus-visible {
  outline: none;
  box-shadow: var(--molcrafts-focus-ring);
}

.molcrafts-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.molcrafts-home-hero {
  position: relative;
  min-height: 25rem;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  /* Paper plate + quiet margin rules + warm wash — printed manual, not dashboard. */
  background:
    linear-gradient(115deg, rgba(251, 246, 228, 0.98) 0%, rgba(251, 246, 228, 0.94) 48%, rgba(242, 218, 157, 0.18) 100%),
    linear-gradient(90deg, rgba(24, 67, 43, 0.065) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(24, 67, 43, 0.05) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, rgba(24, 67, 43, 0.05), rgba(24, 67, 43, 0) 48%),
    var(--md-default-bg-color);
  background-size: auto, 5rem 5rem, 5rem 5rem, auto, auto;
  border-bottom: 1px solid var(--molcrafts-rule-strong);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, #fff 40%, transparent);
}

:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .molcrafts-home-hero {
  background:
    linear-gradient(115deg, rgba(16, 24, 17, 0.98) 0%, rgba(16, 24, 17, 0.94) 48%, rgba(47, 125, 80, 0.16) 100%),
    linear-gradient(90deg, rgba(251, 246, 228, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(251, 246, 228, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, rgba(242, 218, 157, 0.06), rgba(242, 218, 157, 0) 48%),
    var(--md-default-bg-color);
  background-size: auto, 5rem 5rem, 5rem 5rem, auto, auto;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

/* Fine diagonal rules + sparse paper grain; slow drift only when motion is ok. */
.molcrafts-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background:
    linear-gradient(110deg, transparent 0 47.5%, rgba(24, 67, 43, 0.06) 47.5% 47.8%, transparent 47.8% 100%),
    linear-gradient(110deg, transparent 0 63%, rgba(24, 67, 43, 0.045) 63% 63.22%, transparent 63.22% 100%),
    repeating-linear-gradient(110deg, transparent 0 1.7rem, rgba(24, 67, 43, 0.028) 1.7rem 1.74rem, transparent 1.74rem 4.4rem),
    radial-gradient(circle at 18% 22%, rgba(24, 67, 43, 0.03) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 72% 68%, rgba(24, 67, 43, 0.025) 0 0.45px, transparent 0.65px);
  background-size: auto, auto, auto, 3.2rem 3.2rem, 4.1rem 4.1rem;
  transform: translate3d(0, 0, 0);
  animation: molcrafts-manual-drift 36s linear infinite;
}

:is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .molcrafts-home-hero::before {
  background:
    linear-gradient(110deg, transparent 0 47.5%, rgba(242, 218, 157, 0.055) 47.5% 47.8%, transparent 47.8% 100%),
    linear-gradient(110deg, transparent 0 63%, rgba(242, 218, 157, 0.04) 63% 63.22%, transparent 63.22% 100%),
    repeating-linear-gradient(110deg, transparent 0 1.7rem, rgba(251, 246, 228, 0.02) 1.7rem 1.74rem, transparent 1.74rem 4.4rem),
    radial-gradient(circle at 18% 22%, rgba(251, 246, 228, 0.03) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 72% 68%, rgba(251, 246, 228, 0.02) 0 0.45px, transparent 0.65px);
  background-size: auto, auto, auto, 3.2rem 3.2rem, 4.1rem 4.1rem;
}

.molcrafts-home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4.25rem;
  pointer-events: none;
  background: linear-gradient(0deg, var(--md-default-bg-color), transparent);
}

@keyframes molcrafts-manual-drift {
  from {
    background-position: 0 0, 0 0, 0 0;
  }

  to {
    background-position: 6rem 0, 8rem 0, 12rem 0;
  }
}

.molcrafts-home-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 4.8rem 1.6rem 4.15rem;
}

.molcrafts-home-hero__copy {
  max-width: 42rem;
}

.molcrafts-home-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  color: var(--molcrafts-product-accent);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.molcrafts-home-hero__kicker::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.9;
}

/*
 * Hero title gradient. Auto-derived from the product's primary (主) accent
 * `--molcrafts-product-accent`: a deepened shade → the accent → a light tint
 * (the soft, 副, direction). Every product that sets an accent in its
 * zensical.toml gets a gradient title for free — no per-product CSS.
 *
 * The stops are built with OKLCH relative-colour syntax (`oklch(from … l c h)`)
 * so lightness moves while HUE and CHROMA stay put — the gradient stays vivid
 * and on-hue instead of washing out the way an sRGB mix toward #fff/#000 does.
 * The whole gradient is gated behind `@supports`; without relative-colour
 * support the title falls back to the solid accent below (never invisible).
 *
 * A product that wants a bespoke multi-hue gradient (e.g. molpy) can still
 * override `.molcrafts-home-hero h1` from its own extra_css, which loads after
 * this file and, when scoped by product, wins on specificity.
 */
.molcrafts-home-hero h1 {
  margin: 0;
  color: var(--molcrafts-product-accent); /* fallback: solid accent title */
  font-size: 3.45rem;
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

@supports (color: oklch(from red l c h)) {
  .molcrafts-home-hero h1 {
    --molcrafts-title-grad-from: oklch(from var(--molcrafts-product-accent) clamp(0, calc(l - 0.16), 1) c h);
    --molcrafts-title-grad-mid: var(--molcrafts-product-accent);
    --molcrafts-title-grad-to: oklch(from var(--molcrafts-product-accent) clamp(0, calc(l + 0.22), 0.95) c h);
    background: linear-gradient(
      100deg,
      var(--molcrafts-title-grad-from) 0%,
      var(--molcrafts-title-grad-mid) 48%,
      var(--molcrafts-title-grad-to) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* Dark scheme reuses the same injected product accent, so lift every stop's
     lightness to keep the title luminous against the slate background. */
  :is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .molcrafts-home-hero h1 {
    --molcrafts-title-grad-from: oklch(from var(--molcrafts-product-accent) clamp(0, calc(l + 0.06), 1) c h);
    --molcrafts-title-grad-mid: oklch(from var(--molcrafts-product-accent) clamp(0, calc(l + 0.20), 1) c h);
    --molcrafts-title-grad-to: oklch(from var(--molcrafts-product-accent) clamp(0, calc(l + 0.34), 0.96) c h);
  }
}

.molcrafts-home-hero__description {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  color: var(--md-default-fg-color--light);
  font-size: 1.02rem;
  line-height: 1.68;
  letter-spacing: 0.005em;
}

.molcrafts-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.molcrafts-home-hero__button {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--md-primary-fg-color) 26%, transparent);
  border-radius: var(--molcrafts-radius);
  color: var(--md-default-fg-color);
  background: var(--molcrafts-paper);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  box-shadow: var(--molcrafts-shadow-sm);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.molcrafts-home-hero__button::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  margin-left: 0.5rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.85;
}

.molcrafts-home-hero__button--primary {
  color: var(--md-primary-bg-color);
  border-color: var(--md-primary-fg-color);
  background: var(--md-primary-fg-color);
  box-shadow: var(--molcrafts-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.molcrafts-home-hero__button:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
  border-color: var(--molcrafts-product-accent);
  box-shadow: var(--molcrafts-shadow);
  transform: translateY(-1px);
}

.molcrafts-home-hero__button--primary:is(:focus, :hover) {
  color: var(--md-accent-bg-color);
  background: var(--molcrafts-product-accent);
  border-color: var(--molcrafts-product-accent);
  box-shadow: 0 0 0 3px var(--molcrafts-product-accent-soft), var(--molcrafts-shadow);
}

/* Optional right-hand hero aside: install command (one-click copy) + badges,
   driven by hero.install / hero.badges front matter. */
.molcrafts-home-hero__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
}

.molcrafts-home-hero__aside {
  display: grid;
  gap: 0.7rem;
  /* The kicker is .875rem tall with a 1.15rem bottom margin. Offset the
     fixed-width aside by that total so the card starts on the h1's top edge. */
  width: 23rem;
  min-width: 0;
  max-width: 23rem;
  margin-top: 2.025rem;
  margin-left: auto;
}

.molcrafts-home-hero__install {
  position: relative;
  padding: 0.95rem 1.05rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--molcrafts-product-accent) 26%, transparent);
  border-radius: var(--molcrafts-radius-lg);
  background: var(--molcrafts-paper-elevated);
  box-shadow: var(--molcrafts-shadow);
}

.molcrafts-home-hero__install::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  border-radius: 0 0 1px 1px;
  background: linear-gradient(90deg, var(--molcrafts-product-accent), color-mix(in srgb, var(--molcrafts-product-accent) 20%, transparent));
}

.molcrafts-home-hero__install-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--molcrafts-product-accent);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.molcrafts-home-hero__install-tabs {
  display: inline-flex;
  gap: 0.15rem;
  max-width: 100%;
  margin-bottom: 0.62rem;
  padding: 0.12rem;
  border: 1px solid var(--molcrafts-rule);
  border-radius: var(--molcrafts-radius);
  background: color-mix(in srgb, var(--md-default-bg-color) 70%, transparent);
  overflow-x: auto;
}

.molcrafts-home-hero__install-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 1.58rem;
  padding: 0.3rem 0.52rem;
  border: 0;
  border-radius: var(--molcrafts-radius-sm);
  color: var(--md-default-fg-color--light);
  background: transparent;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.molcrafts-home-hero__install-tab:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
}

.molcrafts-home-hero__install-tab--active {
  color: var(--molcrafts-product-accent);
  background: var(--molcrafts-product-accent-soft);
}

.molcrafts-home-hero__install-panel[hidden] {
  display: none;
}

.molcrafts-home-hero__install-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.molcrafts-home-hero__install-row code {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--md-primary-fg-color) 10%, transparent);
  border-radius: var(--molcrafts-radius-sm);
  background: color-mix(in srgb, var(--md-code-bg-color) 92%, transparent);
  color: var(--md-code-fg-color);
  font-family: var(--md-code-font);
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: nowrap;
  overflow-x: auto;
}

.molcrafts-home-hero__install-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem;
  border: 1px solid color-mix(in srgb, var(--md-primary-fg-color) 22%, transparent);
  border-radius: var(--molcrafts-radius-sm);
  color: var(--md-default-fg-color--light);
  background: var(--molcrafts-paper);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.molcrafts-home-hero__install-copy:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
  border-color: var(--molcrafts-product-accent);
  box-shadow: var(--molcrafts-shadow-sm);
  transform: translateY(-1px);
}

.molcrafts-home-hero__install-copy svg {
  width: 0.95rem;
  height: 0.95rem;
}

.molcrafts-home-hero__install-copy svg:last-child {
  display: none;
}

.molcrafts-home-hero__install-copy--done svg:first-child {
  display: none;
}

.molcrafts-home-hero__install-copy--done svg:last-child {
  display: block;
  color: var(--molcrafts-product-accent);
}

.molcrafts-home-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding-top: 0.1rem;
}

.molcrafts-home-hero__badges img {
  display: block;
  height: 1.15rem;
  border-radius: var(--molcrafts-radius-sm);
  opacity: 0.94;
}

@media screen and (max-width: 68em) {
  .molcrafts-home-hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.6rem;
  }

  .molcrafts-home-hero__aside {
    width: 100%;
    max-width: 26rem;
    margin-top: 0;
  }
}

/* Hero entrance: the copy rises in with a slight stagger on page load. The
   ambient ::before drift is independent; both honour prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .molcrafts-home-hero__kicker,
  .molcrafts-home-hero h1,
  .molcrafts-home-hero__description,
  .molcrafts-home-hero__actions,
  .molcrafts-home-hero__aside {
    animation: molcrafts-hero-rise 620ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .molcrafts-home-hero h1 {
    animation-delay: 90ms;
  }

  .molcrafts-home-hero__description {
    animation-delay: 180ms;
  }

  .molcrafts-home-hero__actions {
    animation-delay: 270ms;
  }

  .molcrafts-home-hero__aside {
    animation-delay: 360ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .molcrafts-home-hero::before {
    animation: none;
  }
}

@keyframes molcrafts-hero-rise {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--md-default-fg-color);
  letter-spacing: -0.015em;
}

.md-typeset h1 {
  font-weight: 800;
}

.md-typeset h2 {
  border-bottom: 1px solid var(--molcrafts-rule);
  padding-bottom: 0.28rem;
}

.md-typeset a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

.md-typeset a:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
}

.md-typeset .md-button {
  border-radius: var(--molcrafts-radius);
  font-weight: 700;
  letter-spacing: 0.015em;
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset .md-button--primary {
  background: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

.md-typeset .md-button:is(:focus, :hover) {
  border-color: var(--molcrafts-product-accent);
  color: var(--molcrafts-product-accent);
  box-shadow: var(--molcrafts-shadow);
}

.md-typeset .md-button--primary:is(:focus, :hover) {
  background: var(--molcrafts-product-accent);
  color: var(--md-accent-bg-color);
  box-shadow: 0 0 0 3px var(--molcrafts-product-accent-soft), var(--molcrafts-shadow);
}

.md-typeset code,
.md-typeset pre,
.md-typeset kbd {
  border-radius: var(--molcrafts-radius-sm);
}

.md-typeset pre > code {
  border: 1px solid var(--molcrafts-rule);
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--molcrafts-rule);
  border-left: 0.15rem solid var(--molcrafts-product-accent);
  border-radius: var(--molcrafts-radius);
  background: color-mix(in srgb, var(--md-admonition-bg-color) 90%, var(--molcrafts-product-accent-soft));
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: transparent;
}

.md-typeset .admonition-title {
  border-bottom: 1px solid color-mix(in srgb, var(--md-primary-fg-color) 10%, transparent);
}

.md-typeset table:not([class]) {
  border: 1px solid var(--molcrafts-rule);
  border-radius: var(--molcrafts-radius);
  box-shadow: var(--molcrafts-shadow-sm);
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: color-mix(in srgb, var(--molcrafts-product-accent-soft) 68%, var(--molcrafts-paper));
  color: var(--md-default-fg-color);
  font-weight: 750;
  letter-spacing: 0.01em;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  border-color: color-mix(in srgb, var(--md-primary-fg-color) 11%, transparent);
}

.md-typeset .tabbed-labels {
  border-bottom: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .tabbed-labels > label {
  color: var(--md-default-fg-color--light);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 160ms ease;
}

.md-typeset .tabbed-labels > label:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
}

.md-typeset .tabbed-set:has(> input:nth-child(1):checked) .tabbed-labels > label:nth-child(1),
.md-typeset .tabbed-set:has(> input:nth-child(2):checked) .tabbed-labels > label:nth-child(2),
.md-typeset .tabbed-set:has(> input:nth-child(3):checked) .tabbed-labels > label:nth-child(3),
.md-typeset .tabbed-set:has(> input:nth-child(4):checked) .tabbed-labels > label:nth-child(4),
.md-typeset .tabbed-set:has(> input:nth-child(5):checked) .tabbed-labels > label:nth-child(5),
.md-typeset .tabbed-set:has(> input:nth-child(6):checked) .tabbed-labels > label:nth-child(6) {
  color: var(--molcrafts-product-accent);
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border-color: var(--molcrafts-rule);
  border-radius: var(--molcrafts-radius);
  background: var(--molcrafts-paper);
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset .grid.cards > ul > li:is(:focus-within, :hover),
.md-typeset .grid > .card:is(:focus-within, :hover) {
  border-color: color-mix(in srgb, var(--molcrafts-product-accent) 40%, transparent);
  box-shadow: var(--molcrafts-shadow);
}

.md-typeset .molcrafts-manual-home {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.1rem 1.35rem 0.5rem;
}

.md-typeset .molcrafts-manual-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(13rem, 0.42fr) minmax(0, 1fr);
  gap: 1.35rem 2.55rem;
  align-items: start;
  margin: 0;
  padding: 1.95rem 0;
  border-top: 1px solid var(--molcrafts-rule);
}

.md-typeset .molcrafts-manual-section:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 1.95rem;
  left: -0.72rem;
  width: 0.12rem;
  height: 2.7rem;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--molcrafts-product-accent) 0%, color-mix(in srgb, var(--molcrafts-product-accent) 15%, transparent) 100%);
  opacity: 0.88;
}

.md-typeset .molcrafts-manual-section:first-child {
  padding-top: 0.15rem;
  border-top: 0;
}

.md-typeset .molcrafts-manual-section__header {
  position: sticky;
  top: 4rem;
}

/* Compact sections place a closing paragraph after the code block as a third
   grid child. Under auto-placement it lands in column 1 row 2, but row 1's
   height is driven by the (tall) code block — so the paragraph drops to the
   bottom of the code, orphaned in the narrow left column with a gap above it.
   Span the code block down column 2 so the header and the closing paragraph
   stack in column 1, the paragraph sitting directly beneath the header. */
.md-typeset .molcrafts-manual-section--compact {
  align-content: start;
}

.md-typeset .molcrafts-manual-section--compact > .highlight {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Header stays in normal flow (not sticky) so a short intro never lets the
   pinned header slide over its own body. */
.md-typeset .molcrafts-manual-section--compact .molcrafts-manual-section__header {
  position: static;
}

.md-typeset .molcrafts-manual-eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--molcrafts-product-accent);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.md-typeset .molcrafts-manual-section__header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.38rem;
  line-height: 1.22;
  letter-spacing: -0.018em;
}

.md-typeset .molcrafts-manual-section__header p {
  margin: 0.68rem 0 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.84rem;
  line-height: 1.65;
}

.md-typeset .molcrafts-manual-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--molcrafts-rule-strong);
  border-bottom: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .molcrafts-manual-index a {
  position: relative;
  display: grid;
  grid-template-columns: 2.9rem minmax(9rem, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.78rem 0.55rem 0.78rem 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--md-primary-fg-color) 9%, transparent);
  color: var(--md-default-fg-color);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.md-typeset .molcrafts-manual-index a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 0;
  border-radius: 1px;
  background: var(--molcrafts-product-accent);
  transition: width 160ms ease;
}

.md-typeset .molcrafts-manual-index a:first-child {
  border-top: 0;
}

.md-typeset .molcrafts-manual-index a:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
  background: var(--molcrafts-product-accent-soft);
}

.md-typeset .molcrafts-manual-index a:is(:focus, :hover)::before {
  width: 2px;
}

.md-typeset .molcrafts-manual-index span {
  color: var(--md-default-fg-color--lighter);
  font-family: var(--md-code-font), ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.md-typeset .molcrafts-manual-index strong {
  color: inherit;
  font-size: 0.8rem;
  line-height: 1.35;
}

.md-typeset .molcrafts-manual-index em {
  color: var(--md-default-fg-color--light);
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.55;
}

.md-typeset .molcrafts-workflow-list {
  border-top: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .molcrafts-workflow-list > article {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  gap: 0.4rem 1.1rem;
  min-width: 0;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--molcrafts-rule);
}

.md-typeset .molcrafts-workflow-list__meta {
  grid-row: 1 / span 3;
  color: var(--md-default-fg-color--lighter);
  font-family: var(--md-code-font), ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.md-typeset .molcrafts-workflow-list h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.md-typeset .molcrafts-workflow-list p {
  margin: 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.76rem;
  line-height: 1.55;
}

.md-typeset .molcrafts-workflow-list .highlight,
.md-typeset .molcrafts-workflow-list pre {
  margin: 0.42rem 0 0;
}

.md-typeset .molcrafts-workflow-list pre > code {
  padding: 0.7rem 0.75rem;
  border-left: 0.14rem solid color-mix(in srgb, var(--molcrafts-product-accent) 55%, transparent);
  font-size: 0.7rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.md-typeset .molcrafts-feature-matrix {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  border-top: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .molcrafts-feature-matrix > div {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.34fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--molcrafts-rule);
}

.md-typeset .molcrafts-feature-matrix dt {
  color: var(--md-default-fg-color);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.md-typeset .molcrafts-feature-matrix dd {
  margin: 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.74rem;
  line-height: 1.55;
}

.md-typeset .molcrafts-doc-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.1rem;
  border-top: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .molcrafts-doc-map section {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--molcrafts-rule);
}

.md-typeset .molcrafts-doc-map h3 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.md-typeset .molcrafts-doc-map p {
  margin: 0.42rem 0 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.74rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------------------ *
 * Section & content templates                                              *
 *                                                                          *
 * A manual page composes two orthogonal choices:                           *
 *   1. a SECTION FRAME    — how the titled block splits label vs. content: *
 *        (base)                two columns: sticky label | content         *
 *        --compact            two columns: static label | content, where   *
 *                             a trailing paragraph stacks under the label  *
 *        --stack             single column: eyebrow + title, then content  *
 *                             full width (host wide content / 3-col grids) *
 *   2. a CONTENT TEMPLATE — how the items inside are arranged:             *
 *        molcrafts-manual-grid --cols-2 / --cols-3   responsive card grid  *
 *        molcrafts-manual-list                        vertical row list    *
 *        molcrafts-manual-index                       numbered entry list  *
 * Sub-manuals pick a frame and drop a content template into it, instead of *
 * relying on grid auto-placement.                                          *
 * ------------------------------------------------------------------------ */

/* Stack frame — single column so wide content (tables, diagrams, a 3-column
   card grid) is not cramped into the narrow content column of a split. */
.md-typeset .molcrafts-manual-section--stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.md-typeset .molcrafts-manual-section--stack .molcrafts-manual-section__header {
  position: static;
  max-width: 44rem;
}

/* Card-grid template — a responsive grid of cards. Pick the column count with
   --cols-2 / --cols-3; both collapse on narrower viewports. Each child is a
   card (an <a> for a link, or a <div>) holding <strong> + <em>/<p>. */
.md-typeset .molcrafts-manual-grid {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .molcrafts-manual-grid--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.md-typeset .molcrafts-manual-grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.md-typeset .molcrafts-manual-grid > * {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--molcrafts-rule);
  border-radius: var(--molcrafts-radius);
  color: var(--md-default-fg-color);
  background: var(--molcrafts-paper);
  box-shadow: var(--molcrafts-shadow-sm);
  text-decoration: none;
}

.md-typeset .molcrafts-manual-grid > a {
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.md-typeset .molcrafts-manual-grid > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 0;
  border-radius: 0 1px 1px 0;
  background: var(--molcrafts-product-accent);
  transition: width 160ms ease;
}

.md-typeset .molcrafts-manual-grid > a:is(:focus, :hover) {
  border-color: color-mix(in srgb, var(--molcrafts-product-accent) 40%, transparent);
  background: color-mix(in srgb, var(--molcrafts-product-accent-soft) 70%, var(--molcrafts-paper));
  color: var(--molcrafts-product-accent);
  box-shadow: var(--molcrafts-shadow);
  transform: translateY(-1px);
}

.md-typeset .molcrafts-manual-grid > a:is(:focus, :hover)::before {
  width: 2px;
}

.md-typeset .molcrafts-manual-grid strong {
  display: block;
  color: inherit;
  font-size: 0.84rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.md-typeset .molcrafts-manual-grid em,
.md-typeset .molcrafts-manual-grid p {
  display: block;
  margin: 0.35rem 0 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.55;
}

/* List template — a vertical list of rows, each a label + description. Lighter
   than manual-index (no leading number). Children are <a> or <div>. */
.md-typeset .molcrafts-manual-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--molcrafts-rule-strong);
}

.md-typeset .molcrafts-manual-list > * {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8rem, 0.34fr) minmax(0, 1fr);
  gap: 0.35rem 1.4rem;
  align-items: baseline;
  padding: 0.78rem 0.35rem 0.78rem 0.45rem;
  border-bottom: 1px solid var(--molcrafts-rule);
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.md-typeset .molcrafts-manual-list > a {
  transition: color 160ms ease, background-color 160ms ease;
}

.md-typeset .molcrafts-manual-list > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 0;
  border-radius: 1px;
  background: var(--molcrafts-product-accent);
  transition: width 160ms ease;
}

.md-typeset .molcrafts-manual-list > a:is(:focus, :hover) {
  color: var(--molcrafts-product-accent);
  background: var(--molcrafts-product-accent-soft);
}

.md-typeset .molcrafts-manual-list > a:is(:focus, :hover)::before {
  width: 2px;
}

.md-typeset .molcrafts-manual-list strong {
  color: inherit;
  font-family: var(--md-code-font), ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
}

.md-typeset .molcrafts-manual-list em {
  color: var(--md-default-fg-color--light);
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.55;
}

/* Browser-native MolCrafts embeds. The element rules are useful in any docs
   page; the card/grid rules provide an optional catalog-style presentation. */
.md-typeset :is(molvis-viewer, molplot-chart) {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 1.2rem 0;
  overflow: hidden;
  border: 1px solid var(--molcrafts-rule-strong);
  border-radius: var(--molcrafts-radius);
  background: var(--molcrafts-paper-elevated);
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset molvis-viewer {
  position: relative;
  width: 100%;
  /* Default when the fence omits height. The component applies an explicit
     height="…" as an inline style; do not pin a large min-height over it. */
  height: clamp(16rem, 40vw, 22rem);
  isolation: isolate;
}

.md-typeset molvis-viewer[height] {
  /* Author height wins via the component's inline style. */
  min-height: 0;
}

/* Formatter-backed MolVis representation gallery. Each visible canvas is a
   Babylon Engine View; the component owns one hidden WebGL engine canvas.

   Cards are <figure> elements. Material/Zensical styles figures as
   `width: fit-content; margin: 1em auto; text-align: center` and captions as
   `max-width: 24rem; margin: 1em auto; font-style: italic` — both must be
   overridden or every card shrinks to its canvas bitmap and the grid collapses
   into uneven tiles. */
.md-typeset molvis-style-gallery {
  display: block;
  width: 100%;
  margin: 1.5rem 0 2rem;
}

.md-typeset .molvis-style-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.md-typeset figure.molvis-style-gallery__card,
.md-typeset .molvis-style-gallery__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--molcrafts-rule-strong);
  border-radius: var(--molcrafts-radius-lg);
  background: var(--molcrafts-paper-elevated);
  box-shadow: var(--molcrafts-shadow-sm);
  text-align: left;
}

.md-typeset .molvis-style-gallery__preview {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #33334d;
}

/* Absolute fill so the HTML canvas bitmap size never drives card layout
   (canvas defaults to 300×150 and Babylon resizes the drawing buffer). */
.md-typeset .molvis-style-gallery__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  outline: 0;
  pointer-events: none;
  touch-action: none;
  user-select: none;
}

.md-typeset figcaption.molvis-style-gallery__caption,
.md-typeset .molvis-style-gallery__caption {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-style: normal;
  text-align: left;
}

.md-typeset .molvis-style-gallery__caption strong {
  color: var(--md-default-fg-color);
  font-size: 0.8rem;
  font-weight: 650;
  font-style: normal;
  line-height: 1.35;
}

.md-typeset .molvis-style-gallery__caption code {
  padding: 0.1rem 0.35rem;
  border-radius: var(--molcrafts-radius-sm);
  background: var(--molcrafts-product-accent-soft);
  color: var(--molcrafts-product-accent);
  font-size: 0.68rem;
  font-style: normal;
  white-space: nowrap;
}

/* Only show the caption separator when a caption exists. Use :has()
   so cards without captions keep the card's rounded bottom corners and
   don't display an inner dividing line. */
.md-typeset .molvis-style-gallery__card:has(.molvis-style-gallery__caption) .molvis-style-gallery__caption {
  border-top: 1px solid var(--molcrafts-rule);
}

/* When a card has a caption, remove the preview's bottom radius so the
   caption edge aligns flush. When there's no caption, restore radius so
   there's no visible seam (no "chin"). */
.md-typeset .molvis-style-gallery__card:has(.molvis-style-gallery__caption) .molvis-style-gallery__preview {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.md-typeset .molvis-style-gallery__card:not(:has(.molvis-style-gallery__caption)) .molvis-style-gallery__preview {
  border-bottom-left-radius: var(--molcrafts-radius-lg);
  border-bottom-right-radius: var(--molcrafts-radius-lg);
}

.md-typeset molvis-style-gallery[data-state="loading"] .molvis-style-gallery__preview {
  background:
    linear-gradient(100deg, transparent 20%, var(--molcrafts-product-accent-soft) 45%, transparent 70%),
    var(--molcrafts-paper-elevated);
  background-size: 220% 100%;
  animation: molcrafts-component-loading 1.8s ease-in-out infinite;
}

.md-typeset .molvis-style-gallery__error {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #b42318 45%, transparent);
  border-radius: var(--molcrafts-radius);
  background: color-mix(in srgb, #b42318 8%, var(--molcrafts-paper));
  color: #b42318;
  font-size: 0.76rem;
}

/* Docs host for <molplot-chart>.

   Default aspect is 4:3 (fence default). Standalone fences cap width so a full
   content column does not billboard; inside .molcrafts-figure the chart fills
   the card face (see figure rules below).

   Type size is owned by @molcrafts/molplot fontScale (layout metrics must match
   painted glyphs — pure CSS font-size blows past Vega's reserved label slots
   and clips titles). Do not !important-override SVG text here. */
.md-typeset molplot-chart,
.md-typeset [data-molplot-chart] {
  --molplot-width: min(100%, 36rem);
  --molplot-aspect: 4 / 3;
  display: block;
  position: relative;
  box-sizing: border-box;
  width: min(100%, 36rem);
  max-width: 36rem;
  margin-inline: auto;
  aspect-ratio: var(--molplot-aspect, 4 / 3);
  overflow: hidden;
  background: #fff;
  color: #14271d;
}

/* Surface fills the host; SVG keeps its layout size from Vega (no stretch). */
.md-typeset molplot-chart .vega-embed,
.md-typeset [data-molplot-chart] .vega-embed,
.md-typeset molplot-chart .molplot-chart__surface,
.md-typeset [data-molplot-chart] .molplot-chart__surface {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.md-typeset molplot-chart .vega-embed > svg,
.md-typeset [data-molplot-chart] .vega-embed > svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.md-typeset .molplot {
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
}

.md-typeset :is(molvis-viewer, molplot-chart)[data-state="loading"] {
  background:
    linear-gradient(100deg, transparent 20%, var(--molcrafts-product-accent-soft) 45%, transparent 70%),
    var(--molcrafts-paper-elevated);
  background-size: 220% 100%;
  animation: molcrafts-component-loading 1.8s ease-in-out infinite;
}

@keyframes molcrafts-component-loading {
  to {
    background-position: -220% 0;
  }
}

/* Framed figure card for MolVis / MolPlot embeds.
 *
 * One card wraps canvas + caption (border / radius / shadow). Inside: canvas
 * flush on top, paper-style "Figure N." caption as the chin — no product tag.
 *
 *   <figure id="fig-water" class="molcrafts-figure">
 *     <div class="molcrafts-figure__body">…viewer/chart…</div>
 *     <figcaption>
 *       <span class="molcrafts-figure__label">Figure 1.</span>
 *       Caption text.
 *     </figcaption>
 *   </figure>
 *
 *   See [Figure 1](#fig-water).
 *
 * Legacy class names (molcrafts-web-component-*) map to the same look.
 */
.md-typeset figure.molcrafts-figure,
.md-typeset figure.molcrafts-web-component-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 1.75rem 0 2.1rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--molcrafts-rule-strong);
  border-radius: var(--molcrafts-radius-lg);
  background: var(--molcrafts-paper);
  box-shadow: var(--molcrafts-shadow);
  text-align: center;
}

/* Body first, caption second — even when the HTML lists figcaption first. */
.md-typeset figure.molcrafts-figure > .molcrafts-figure__body,
.md-typeset figure.molcrafts-figure > .molcrafts-web-component-preview,
.md-typeset figure.molcrafts-web-component-card > .molcrafts-figure__body,
.md-typeset figure.molcrafts-web-component-card > .molcrafts-web-component-preview {
  order: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

/*
 * Embed fills the card face: drop the standalone embed chrome so we do not
 * get a card-in-card (outer figure frame + inner viewer border).
 */
.md-typeset figure.molcrafts-figure :is(molvis-viewer, molplot-chart),
.md-typeset figure.molcrafts-web-component-card :is(molvis-viewer, molplot-chart),
.md-typeset .molcrafts-figure__body :is(molvis-viewer, molplot-chart),
.md-typeset .molcrafts-web-component-preview :is(molvis-viewer, molplot-chart) {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.md-typeset figure.molcrafts-figure molvis-viewer,
.md-typeset figure.molcrafts-web-component-card molvis-viewer,
.md-typeset .molcrafts-figure__body molvis-viewer,
.md-typeset .molcrafts-web-component-preview molvis-viewer {
  background: transparent;
}

.md-typeset figure.molcrafts-figure molplot-chart,
.md-typeset figure.molcrafts-web-component-card molplot-chart,
.md-typeset .molcrafts-figure__body molplot-chart,
.md-typeset .molcrafts-web-component-preview molplot-chart {
  background: #fff;
}

/* Caption chin: same size as body copy (.md-typeset ≈ 0.8rem), paper figure type. */
.md-typeset figure.molcrafts-figure > figcaption,
.md-typeset figure.molcrafts-web-component-card > figcaption {
  order: 2;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.65rem 1rem 0.78rem;
  border: none;
  border-top: 1px solid var(--molcrafts-rule);
  background: var(--molcrafts-paper);
  color: var(--md-default-fg-color--light);
  font-size: 0.8rem; /* match .md-typeset body */
  font-style: normal;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
}

.md-typeset figure.molcrafts-figure > figcaption strong,
.md-typeset figure.molcrafts-web-component-card > figcaption strong {
  font-size: inherit;
  font-weight: 650;
  color: var(--md-default-fg-color);
}

.md-typeset figure.molcrafts-figure > figcaption small,
.md-typeset figure.molcrafts-web-component-card > figcaption small {
  display: inline;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* "Figure N." — bold, slightly darker than the rest of the caption. */
.md-typeset .molcrafts-figure__label {
  margin-right: 0.3em;
  color: var(--md-default-fg-color);
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Drop the old product chip entirely. */
.md-typeset .molcrafts-web-component-card__package,
.md-typeset .molcrafts-figure__package {
  display: none !important;
}

.md-typeset .molcrafts-figure__body molvis-viewer,
.md-typeset .molcrafts-web-component-preview molvis-viewer {
  width: 100%;
  height: clamp(18rem, 38vw, 22rem);
}

/*
 * Chart body: generous inset so axis titles / legends are not flush to the
 * card edge. Chart host is full width of the card (no 36rem cap).
 */
.md-typeset .molcrafts-figure__body--chart,
.md-typeset .molcrafts-web-component-preview--chart {
  display: block;
  width: 100%;
  min-height: auto;
  /* Air between card chrome and the white plot surface. */
  padding: 1rem 1rem 0.75rem;
  background: var(--molcrafts-paper);
  box-sizing: border-box;
}

.md-typeset .molcrafts-figure__body--chart .molplot,
.md-typeset .molcrafts-web-component-preview--chart .molplot,
.md-typeset figure.molcrafts-figure .molplot,
.md-typeset figure.molcrafts-web-component-card .molplot {
  width: 100%;
  max-width: none;
  margin: 0;
}

/*
 * Multi-legend docs charts need width more than height (legends sit on the
 * right). 16/10 gives the plot room without the 4/3 tall empty chin.
 */
.md-typeset .molcrafts-figure__body--chart molplot-chart,
.md-typeset .molcrafts-web-component-preview--chart molplot-chart,
.md-typeset figure.molcrafts-figure molplot-chart,
.md-typeset figure.molcrafts-web-component-card molplot-chart {
  --molplot-width: 100%;
  --molplot-aspect: 16 / 10;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 16 / 10;
  padding: 0.5rem !important;
  box-sizing: border-box;
  background: #fff;
  border-radius: var(--molcrafts-radius-sm);
}

.md-typeset .molcrafts-figure__body--chart molplot-chart > .molplot-chart__surface,
.md-typeset figure.molcrafts-figure molplot-chart > .molplot-chart__surface,
.md-typeset figure.molcrafts-web-component-card molplot-chart > .molplot-chart__surface {
  inset: 0.5rem !important;
}

/* Optional multi-figure row (side-by-side panels). */
.md-typeset .molcrafts-figure-grid,
.md-typeset .molcrafts-web-component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  margin: 1.4rem 0 2rem;
  align-items: start;
}

.md-search__form,
.md-search__input,
.md-search__output,
.md-search-result__meta {
  border-radius: var(--molcrafts-radius);
}

.md-nav__link:is(:focus, :hover),
.md-nav__link--active {
  color: var(--molcrafts-product-accent);
}

.md-nav--secondary .md-nav__title {
  color: var(--md-default-fg-color);
  letter-spacing: 0.02em;
}

.md-footer {
  margin-top: 2.4rem;
  border-top: 1px solid rgba(14, 43, 27, 0.25);
}

@media screen and (max-width: 76.2344em) {
  .md-nav--primary .md-nav__title[for="__drawer"] {
    background: var(--md-primary-fg-color);
    color: var(--md-primary-bg-color);
  }
}

@media screen and (max-width: 60em) {
  .molcrafts-home-hero {
    min-height: auto;
    background:
      linear-gradient(135deg, rgba(251, 246, 228, 0.98) 0%, rgba(251, 246, 228, 0.92) 56%, rgba(242, 218, 157, 0.16) 100%),
      linear-gradient(90deg, rgba(24, 67, 43, 0.06) 0 1px, transparent 1px 100%),
      linear-gradient(0deg, rgba(24, 67, 43, 0.045) 0 1px, transparent 1px 100%);
    background-size: auto, 3.6rem 3.6rem, 3.6rem 3.6rem;
  }

  :is([data-md-color-scheme="slate"], [data-md-color-scheme="molcrafts-slate"]) .molcrafts-home-hero {
    background:
      linear-gradient(135deg, rgba(16, 24, 17, 0.98) 0%, rgba(16, 24, 17, 0.92) 56%, rgba(47, 125, 80, 0.14) 100%),
      linear-gradient(90deg, rgba(251, 246, 228, 0.05) 0 1px, transparent 1px 100%),
      linear-gradient(0deg, rgba(251, 246, 228, 0.04) 0 1px, transparent 1px 100%);
    background-size: auto, 3.6rem 3.6rem, 3.6rem 3.6rem;
  }

  .molcrafts-home-hero__inner {
    gap: 1.35rem;
    padding: 3.1rem 1rem 2.7rem;
  }

  .molcrafts-home-hero h1 {
    font-size: 2.5rem;
    line-height: 1.06;
  }

  .molcrafts-home-hero__description {
    font-size: 0.92rem;
  }

  .molcrafts-home-hero__aside {
    gap: 0.55rem;
  }

  .md-typeset .molcrafts-manual-home {
    padding: 1.7rem 1rem 0.35rem;
  }

  .md-typeset .molcrafts-manual-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.55rem 0;
  }

  /* Single column on narrow viewports — undo the desktop code-block span so
     it stacks in normal source order instead of an implicit second column. */
  .md-typeset .molcrafts-manual-section--compact > .highlight {
    grid-column: 1;
    grid-row: auto;
  }

  .md-typeset .molcrafts-manual-section__header {
    position: static;
  }

  .md-typeset .molcrafts-manual-index a {
    grid-template-columns: 2.6rem minmax(8rem, 0.42fr) minmax(0, 1fr);
  }

  .md-typeset .molcrafts-feature-matrix,
  .md-typeset .molcrafts-doc-map {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Card grid steps down: three columns → two, two columns → one. */
  .md-typeset .molcrafts-manual-grid--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-typeset .molcrafts-manual-grid--cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* List rows stack their label over the description. */
  .md-typeset .molcrafts-manual-list > * {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .md-typeset .molcrafts-figure-grid,
  .md-typeset .molcrafts-web-component-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .md-typeset .molcrafts-figure__body molvis-viewer,
  .md-typeset .molcrafts-web-component-preview molvis-viewer {
    height: clamp(18rem, 58vw, 22rem);
  }

  .md-typeset .molcrafts-figure__body--chart,
  .md-typeset .molcrafts-web-component-preview--chart {
    min-height: auto;
  }
}

@media screen and (max-width: 36em) {
  .molcrafts-home-hero {
    min-height: auto;
  }

  .molcrafts-home-hero__inner {
    padding: 2.2rem 0.75rem 2.1rem;
  }

  .molcrafts-home-hero h1 {
    font-size: 2.25rem;
  }

  .molcrafts-home-hero__description {
    margin-top: 0.85rem;
  }

  .molcrafts-home-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.48rem;
    margin-top: 1.15rem;
  }

  .molcrafts-home-hero__button {
    justify-content: space-between;
  }

  .molcrafts-home-hero__install {
    padding: 0.8rem 0.85rem 0.9rem;
  }

  .molcrafts-home-hero__install-row code {
    font-size: 0.68rem;
  }

  .md-typeset .molcrafts-manual-home {
    padding: 1.25rem 0.75rem 0.25rem;
  }

  .md-typeset .molcrafts-manual-section {
    padding: 1.25rem 0;
  }

  .md-typeset .molcrafts-manual-section:not(:first-child)::before {
    left: -0.38rem;
    top: 1.25rem;
    height: 2.2rem;
  }

  .md-typeset .molcrafts-manual-section__header h2 {
    font-size: 1.16rem;
  }

  .md-typeset .molcrafts-manual-index a,
  .md-typeset .molcrafts-workflow-list > article,
  .md-typeset .molcrafts-feature-matrix > div,
  .md-typeset .molcrafts-manual-grid--cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .md-typeset .molcrafts-manual-index em,
  .md-typeset .molcrafts-workflow-list__meta {
    grid-row: auto;
  }

  .md-typeset :is(molvis-viewer, molplot-chart) {
    border-radius: var(--molcrafts-radius-sm);
  }

  .md-typeset molvis-viewer,
  .md-typeset .molcrafts-figure__body molvis-viewer,
  .md-typeset .molcrafts-web-component-preview molvis-viewer {
    height: 18rem;
    min-height: 18rem;
  }

  .md-typeset figure.molcrafts-figure > figcaption,
  .md-typeset figure.molcrafts-web-component-card > figcaption {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset :is(molvis-viewer, molplot-chart)[data-state="loading"],
  .md-typeset molvis-style-gallery[data-state="loading"] .molvis-style-gallery__preview {
    animation: none;
  }
}

@media screen and (max-width: 44em) {
  .md-typeset .molvis-style-gallery__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .md-typeset molplot-chart,
  .md-typeset [data-molplot-chart],
  .md-typeset .molplot {
    max-width: 100%;
    width: 100%;
    --molplot-width: 100%;
  }
}

@media screen and (min-width: 90em) {
  /* Wide content columns: still prefer a readable 2×N gallery, not a sparse
     single row of tiny cards. */
  .md-typeset .molvis-style-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Bundled mkdocstrings C++ handler. Zensical 0.0.45 renders handler
   templates but does not emit their companion stylesheet, so the theme owns
   the visible integration as part of its normal CSS bundle. */
.md-typeset .cpp-object {
  margin: 1.25rem 0;
}

.md-typeset .cpp-kind {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  margin-bottom: 0.3rem;
  padding: 0.08rem 0.42rem;
  border: 0.05rem solid color-mix(in srgb, var(--molcrafts-product-accent) 28%, transparent);
  border-radius: 999px;
  background: var(--molcrafts-product-accent-soft);
  color: var(--molcrafts-product-accent);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.md-typeset .cpp-signature pre {
  margin: 0.5rem 0 0.85rem;
  border: 0.05rem solid var(--molcrafts-rule);
  border-radius: var(--molcrafts-radius-sm);
  box-shadow: var(--molcrafts-shadow-sm);
}

.md-typeset .cpp-signature code {
  white-space: pre-wrap;
}

.md-typeset :is(.cpp-params, .cpp-enum-values) {
  overflow-x: auto;
}

.md-typeset :is(.cpp-params, .cpp-enum-values) table {
  display: table;
  width: 100%;
}

.md-typeset :is(.cpp-params, .cpp-enum-values) :is(th, td):first-child {
  width: 1%;
  white-space: nowrap;
}

.md-typeset .cpp-location {
  color: var(--md-default-fg-color--light);
  font-size: 0.78rem;
}

.md-typeset .cpp-children {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 0.1rem solid var(--molcrafts-rule-strong);
}

@media screen and (max-width: 36em) {
  .md-typeset .cpp-children {
    padding-left: 0.65rem;
  }
}
