/* Article delivery styles are scoped so theme CSS cannot break stored HTML fragments. */

/* ── Global SR-Only & Scholarly Fragment Helpers ── */
/* These are NOT scoped to .wasabi-article-markdown-wrapper because title/abstract
   fragments render outside that wrapper. The .sr-only class comes from Google Scholar
   HTML exports and must be hidden visually while remaining accessible. */
.sr-only,
.wma-title-fragment .math-semantic,
.wma-abstract-fragment .math-semantic {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hide any residual text from stripped <style> tags with this class */
.scholarly-sr-only-def {
  display: none !important;
}

.gj-content-sectioncode {
  background-color: #0000000a !important;
}

/* SVG math-defs sprites must stay invisible */
.wma-title-fragment .math-defs-sprite,
.wma-abstract-fragment .math-defs-sprite {
  display: none !important;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Math rendering inside title/abstract fragments */
.wma-title-fragment .math-visual,
.wma-abstract-fragment .math-visual {
  max-width: 100%;
}

.wma-title-fragment .math-inline,
.wma-abstract-fragment .math-inline,
.wma-title-fragment .math-inline .math-visual,
.wma-abstract-fragment .math-inline .math-visual,
.wma-title-fragment .math-inline mjx-container,
.wma-abstract-fragment .math-inline mjx-container {
  white-space: nowrap !important;
  display: inline-block !important;
}

.wma-title-fragment .math-semantic,
.wma-abstract-fragment .math-semantic,
.wma-title-fragment .math-semantic *,
.wma-abstract-fragment .math-semantic * {
  color: transparent !important;
}

.wma-title-fragment mjx-container,
.wma-abstract-fragment mjx-container {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  text-indent: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  word-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  float: none;
  direction: ltr;
}

.wma-title-fragment mjx-container[jax="SVG"]>svg,
.wma-abstract-fragment mjx-container[jax="SVG"]>svg {
  overflow: visible;
  min-height: 1px;
  min-width: 1px;
  max-width: none;
  height: auto;
}

.wma-title-fragment mjx-container[jax="SVG"] path[data-c],
.wma-abstract-fragment mjx-container[jax="SVG"] path[data-c],
.wma-title-fragment mjx-container[jax="SVG"] use[data-c],
.wma-abstract-fragment mjx-container[jax="SVG"] use[data-c] {
  fill: currentColor !important;
  stroke: none !important;
  stroke-width: 0 !important;
}

/* Title fragment: always white text, Prata font (loaded by theme) */
.wma-title-fragment,
.wma-title-fragment .scholarly-title-fragment,
.wma-title-fragment .scholarly-title-fragment p,
.wma-title-fragment mjx-container[jax="SVG"]>svg {
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
}

.wma-title-fragment,
.wma-title-fragment .scholarly-title-fragment,
.wma-title-fragment .scholarly-title-fragment p {
  font-family: 'Prata', serif !important;
}

/* ── End Global SR-Only & Scholarly Fragment Helpers ── */
.wasabi-article-markdown-wrapper {
  --wma-font-size: 16px;
  --wma-line-height: 1.75;
  --wma-heading-line-height: 1.22;
  --wma-space-xs: .45em;
  --wma-space-sm: .75em;
  --wma-space-md: 1.15em;
  --wma-space-lg: 1.65em;
  --wma-space-xl: 2.05em;
  --wma-heading-gap-h1: 2.25em;
  --wma-heading-gap-h2: 2em;
  --wma-heading-gap-h3: 1.65em;
  --wma-heading-gap-h4: 1.35em;

  max-width: 100%;
  margin: 0 auto;
  color: inherit;
  font-family: inherit;
  font-size: var(--wma-font-size);
  line-height: var(--wma-line-height);
}

.wasabi-article-markdown-wrapper .wma-article-body {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.wasabi-article-markdown-wrapper .wma-article-body> :first-child {
  margin-top: 0;
}

.wasabi-article-markdown-wrapper .wma-article-body> :last-child {
  margin-bottom: 0;
}

.wasabi-article-markdown-wrapper p {
  margin: 0 0 var(--wma-space-md);
}

.wasabi-article-markdown-wrapper h1,
.wasabi-article-markdown-wrapper h2,
.wasabi-article-markdown-wrapper h3,
.wasabi-article-markdown-wrapper h4,
.wasabi-article-markdown-wrapper h5,
.wasabi-article-markdown-wrapper h6 {
  max-width: 100%;
  margin: var(--wma-space-xl) 0 var(--wma-space-sm) !important;
  color: inherit;
  font-family: inherit;
  font-weight: 650;
  line-height: var(--wma-heading-line-height) !important;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  scroll-margin-top: 90px;
}

.wasabi-article-markdown-wrapper h1 {
  margin-top: var(--wma-heading-gap-h1) !important;
  font-size: 2.25rem;
}

.wasabi-article-markdown-wrapper h2 {
  margin-top: var(--wma-heading-gap-h2) !important;
  font-size: 1.9rem;
}

.wasabi-article-markdown-wrapper h3 {
  margin-top: var(--wma-heading-gap-h3) !important;
  font-size: 1.55rem;
}

.wasabi-article-markdown-wrapper h4 {
  margin-top: var(--wma-heading-gap-h4) !important;
  font-size: 1.3rem;
}

.wasabi-article-markdown-wrapper h5 {
  margin-top: 1.15em !important;
  font-size: 1.12rem;
}

.wasabi-article-markdown-wrapper h6 {
  margin-top: 1em !important;
  font-size: 1rem;
  letter-spacing: 0;
}

.wasabi-article-markdown-wrapper .wma-article-body>h1:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h2:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h3:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h4:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h5:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h6:first-child {
  margin-top: 0 !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h1 {
  margin-top: var(--wma-heading-gap-h1) !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h2 {
  margin-top: var(--wma-heading-gap-h2) !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h3 {
  margin-top: var(--wma-heading-gap-h3) !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h4 {
  margin-top: var(--wma-heading-gap-h4) !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h5 {
  margin-top: 1.15em !important;
}

.wasabi-article-markdown-wrapper .wma-article-body h6 {
  margin-top: 1em !important;
}

.wasabi-article-markdown-wrapper .wma-article-body>h1:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h2:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h3:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h4:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h5:first-child,
.wasabi-article-markdown-wrapper .wma-article-body>h6:first-child {
  margin-top: 0 !important;
}

.wasabi-article-markdown-wrapper h1+p,
.wasabi-article-markdown-wrapper h2+p,
.wasabi-article-markdown-wrapper h3+p,
.wasabi-article-markdown-wrapper h4+p,
.wasabi-article-markdown-wrapper h5+p,
.wasabi-article-markdown-wrapper h6+p {
  margin-top: 0;
}

.wasabi-article-markdown-wrapper a {
  overflow-wrap: anywhere;
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
  color: #2563eb;
}

.wasabi-article-markdown-wrapper a:hover {
  color: #1d4ed8;
}

.wasabi-article-markdown-wrapper img {
  max-width: 100%;
  height: auto;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

.wasabi-article-markdown-wrapper figure {
  max-width: 100%;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

.wasabi-article-markdown-wrapper blockquote::before {
  display: none !important;
}

.wasabi-article-markdown-wrapper figcaption {
  max-width: 100%;
  margin-top: var(--wma-space-xs);
  font-size: .92em;
  line-height: 1.55;
  opacity: .78;
  text-align: center;
}

.wasabi-article-markdown-wrapper ul,
.wasabi-article-markdown-wrapper ol {
  max-width: 100%;
  margin: 0 0 var(--wma-space-md);
  padding-left: 1.65em;
}

.wasabi-article-markdown-wrapper li {
  display: list-item !important;
  max-width: 100%;
  margin: .34em 0;
  padding-left: .05em;
}

.wasabi-article-markdown-wrapper li::marker {
  font-size: .92em;
}

.wasabi-article-markdown-wrapper li>p {
  display: inline !important;
  margin: 0 !important;
}

.wasabi-article-markdown-wrapper li>p+p {
  display: block !important;
  margin-top: .35em !important;
}

.wasabi-article-markdown-wrapper li>p:last-child {
  margin-bottom: 0 !important;
}

.wasabi-article-markdown-wrapper li> :first-child {
  margin-top: 0 !important;
}

.wasabi-article-markdown-wrapper li>ul,
.wasabi-article-markdown-wrapper li>ol {
  margin: .45em 0 .65em;
  padding-left: 1.35em;
}

.wasabi-article-markdown-wrapper blockquote {
  max-width: 100%;
  margin: var(--wma-space-lg) 0;
  padding: .15em 0 .15em 1em;
  border-left: 3px solid currentColor;
  font-size: 17px !important;
  line-height: 1.5 !important;
  opacity: .9;
}

.wasabi-article-markdown-wrapper blockquote> :last-child {
  margin-bottom: 0;
}

.wasabi-article-markdown-wrapper table {
  width: 100%;
  max-width: 100%;
  display: block;
  margin: var(--wma-space-lg) 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .95em;
  line-height: 1.55;
}

.wasabi-article-markdown-wrapper th,
.wasabi-article-markdown-wrapper td {
  padding: .55em .7em;
  vertical-align: top;
  /* .wma-article-body uses overflow-wrap:anywhere, which is inherited here and
     shrinks the column min-content width to ~1 char, so words like "Period"
     split mid-word ("Perio/d"). break-word keeps whole words intact and only
     breaks a word when it is longer than the cell. */
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

.wasabi-article-markdown-wrapper pre {
  max-width: 100%;
  margin: var(--wma-space-lg) 0;
  padding: .95em 1em;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 4px;
  background: rgba(0, 0, 0, .04);
  line-height: 1.55;
}

.wasabi-article-markdown-wrapper code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .92em;
}

.wasabi-article-markdown-wrapper .math-visual {
  max-width: 100%;
}

.wasabi-article-markdown-wrapper .math-inline,
.wasabi-article-markdown-wrapper .math-inline .math-visual,
.wasabi-article-markdown-wrapper .math-inline mjx-container,
.wasabi-article-markdown-wrapper .math-inline .math-semantic,
.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback,
.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback .math-semantic,
.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback mjx-container,
.wasabi-article-markdown-wrapper .math.wma-math-fallback,
.wasabi-article-markdown-wrapper .math.wma-math-fallback .math-semantic,
.wasabi-article-markdown-wrapper .math.wma-math-fallback mjx-container {
  white-space: nowrap !important;
  display: inline-block !important;
}

.wasabi-article-markdown-wrapper .math-semantic {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wasabi-article-markdown-wrapper .math-semantic,
.wasabi-article-markdown-wrapper .math-semantic * {
  color: transparent !important;
}

.wasabi-article-markdown-wrapper .wma-math-fallback>.math-visual {
  display: none !important;
}

.wasabi-article-markdown-wrapper .wma-math-fallback>.math-semantic {
  position: static !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap !important;
}

.wasabi-article-markdown-wrapper .wma-math-fallback>.math-semantic,
.wasabi-article-markdown-wrapper .wma-math-fallback>.math-semantic * {
  color: #111427 !important;
}

.wasabi-article-markdown-wrapper .equation-display.wma-math-fallback {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1.2em 0 1.45em !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  text-align: center !important;
  clear: both !important;
}

.wasabi-article-markdown-wrapper .equation-display.wma-math-fallback>.math-visual {
  display: none !important;
}

.wasabi-article-markdown-wrapper .equation-display.wma-math-fallback>.math-semantic {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: center !important;
  white-space: normal !important;
  margin: 0 auto !important;
}

.wasabi-article-markdown-wrapper .equation-display.wma-math-fallback>.math-semantic mjx-container {
  display: block !important;
  text-align: center !important;
  margin: .85em auto 1em !important;
  color: #111427 !important;
  max-width: 100% !important;
}

.wasabi-article-markdown-wrapper .equation-display.wma-math-fallback>.math-semantic math {
  display: block !important;
  text-align: center !important;
  margin: .85em auto 1em !important;
  color: #111427 !important;
  max-width: 100% !important;
}

.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback>.math-semantic,
.wasabi-article-markdown-wrapper .math.wma-math-fallback>.math-semantic {
  display: inline !important;
}

.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback>.math-semantic mjx-container,
.wasabi-article-markdown-wrapper .math.wma-math-fallback>.math-semantic mjx-container,
.wasabi-article-markdown-wrapper .math-inline.wma-math-fallback>.math-semantic math,
.wasabi-article-markdown-wrapper .math.wma-math-fallback>.math-semantic math {
  display: inline-block !important;
  margin: 0 !important;
  white-space: nowrap !important;
  color: #111427 !important;
}

.wasabi-article-markdown-wrapper .equation-display {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 1.2em 0 1.45em !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 100% !important;
}

.wasabi-article-markdown-wrapper .equation-display .math-visual,
.wasabi-article-markdown-wrapper .equation-display .math-ssr,
.wasabi-article-markdown-wrapper .equation-display .math-ssr-desktop {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100% !important;
}

.wasabi-article-markdown-wrapper .math-ssr {
  max-width: 100%;
}

.wasabi-article-markdown-wrapper .math-ssr-mobile {
  display: none;
}

.wasabi-article-markdown-wrapper mjx-container {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  text-indent: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  word-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  float: none;
  direction: ltr;
}

.wasabi-article-markdown-wrapper mjx-container[display="true"],
.wasabi-article-markdown-wrapper mjx-container[display] {
  display: block !important;
  text-align: center !important;
  margin: .85em auto !important;
  padding: .25em 2px;
  overflow-x: auto;
  overflow-y: hidden;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"]>svg {
  overflow: visible;
  min-height: 1px;
  min-width: 1px;
  max-width: none;
  height: auto;
  color: #111427 !important;
  fill: #111427 !important;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] path[data-c],
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] use[data-c] {
  fill: currentColor !important;
  stroke: none !important;
  stroke-width: 0 !important;
}

.wasabi-article-markdown-wrapper .math-visual,
.wasabi-article-markdown-wrapper .equation-display,
.wasabi-article-markdown-wrapper .math-inline,
.wasabi-article-markdown-wrapper mjx-container,
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"],
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] * {
  color: #111427 !important;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] g,
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] line,
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] text {
  fill: currentColor !important;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] [fill]:not([fill="none"]) {
  fill: currentColor !important;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] [fill="none"],
.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] rect[fill="none"] {
  fill: none !important;
}

.wasabi-article-markdown-wrapper mjx-container[jax="SVG"] [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
  stroke-width: inherit !important;
}

@media (max-width: 640px) {
  .wasabi-article-markdown-wrapper {
    --wma-font-size: 15.5px;
    --wma-line-height: 1.7;
    --wma-space-md: 1.05em;
    --wma-space-lg: 1.35em;
    --wma-space-xl: 1.65em;
    --wma-heading-gap-h1: 1.85em;
    --wma-heading-gap-h2: 1.7em;
    --wma-heading-gap-h3: 1.45em;
    --wma-heading-gap-h4: 1.25em;
  }

  .wasabi-article-markdown-wrapper h1 {
    font-size: 1.75rem;
  }

  .wasabi-article-markdown-wrapper h2 {
    font-size: 1.52rem;
  }

  .wasabi-article-markdown-wrapper h3 {
    font-size: 1.3rem;
  }

  .wasabi-article-markdown-wrapper h4 {
    font-size: 1.15rem;
  }

  .wasabi-article-markdown-wrapper h5 {
    font-size: 1.03rem;
  }

  .wasabi-article-markdown-wrapper h6 {
    font-size: .98rem;
  }

  .wasabi-article-markdown-wrapper ul,
  .wasabi-article-markdown-wrapper ol {
    padding-left: 1.35em;
  }

  .wasabi-article-markdown-wrapper li>ul,
  .wasabi-article-markdown-wrapper li>ol {
    padding-left: 1.2em;
  }

  .wasabi-article-markdown-wrapper table {
    font-size: .9em;
  }

  .wasabi-article-markdown-wrapper .math-ssr-desktop {
    display: none;
  }

  .wasabi-article-markdown-wrapper .math-ssr-mobile {
    display: inline;
  }

  .wasabi-article-markdown-wrapper .equation-display .math-ssr-mobile {
    display: block;
  }

  /* The base .equation-display .math-ssr-desktop rule is display:flex !important,
     so the non-important display:none above never won and both SSR variants were
     rendered side by side on phones (duplicate/overlapping equation + tag). */
  .wasabi-article-markdown-wrapper .equation-display .math-ssr-desktop {
    display: none !important;
  }

  /* Plain "center" on an overflowing flex row clips the start of the equation
     where it cannot be scrolled to. "safe center" falls back to start alignment
     only when the equation is wider than the screen; older browsers without
     "safe" keep the flex-start line and just left-align. */
  .wasabi-article-markdown-wrapper .equation-display,
  .wasabi-article-markdown-wrapper .equation-display .math-visual,
  .wasabi-article-markdown-wrapper .equation-display .math-ssr,
  .wasabi-article-markdown-wrapper .equation-display .math-ssr-mobile {
    justify-content: flex-start !important;
    justify-content: safe center !important;
  }
}

/* ── Table of Contents (TOC) Math Visual & SVG Styles ── */
.wma-toc-wrapper .math-visual,
.wma-toc-list .math-visual,
.gj-tab-submenu .math-visual {
  display: inline-block !important;
  vertical-align: middle !important;
}

.wma-toc-wrapper mjx-container,
.wma-toc-list mjx-container,
.gj-tab-submenu mjx-container {
  display: inline-block !important;
  line-height: 0 !important;
  text-indent: 0 !important;
  text-align: left !important;
  vertical-align: middle !important;
}

.wma-toc-wrapper mjx-container>svg,
.wma-toc-list mjx-container>svg,
.gj-tab-submenu mjx-container>svg,
.scholarly-toc-link mjx-container>svg {
  display: inline-block !important;
  overflow: visible !important;
  vertical-align: middle !important;
  color: inherit !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  max-width: 100% !important;
}

.wma-toc-wrapper .math-semantic,
.wma-toc-list .math-semantic,
.gj-tab-submenu .math-semantic,
.wma-toc-wrapper .sr-only,
.wma-toc-list .sr-only,
.gj-tab-submenu .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Nested <ol> Table of Contents (TOC) Tree Styles ── */
.wma-toc-wrapper ol,
.wma-toc-wrapper ul,
.gj-tab-submenu ol,
.gj-tab-submenu ul,
.wma-toc-list,
ol.wma-toc-list,
ul.wma-toc-list,
#gj-article-tabs-wrapper .gj-tab-submenu ol,
#gj-article-tabs-wrapper .gj-tab-submenu ul,
#gj-article-tabs-wrapper .qodef-tabs-navigation ol,
#gj-article-tabs-wrapper .qodef-tabs-navigation ul {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Root list layout & gap */
.gj-tab-submenu .wma-toc-list,
.wma-toc-wrapper .wma-toc-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

/* Nested sub-lists: tight gap, left margin & clear vertical hierarchy line */
.wma-toc-wrapper ol ol,
.wma-toc-wrapper ul ul,
.gj-tab-submenu ol ol,
.gj-tab-submenu ul ul,
.wma-toc-wrapper ol.wma-toc-list ol.wma-toc-list,
.gj-tab-submenu ol.wma-toc-list ol.wma-toc-list,
#gj-article-tabs-wrapper .gj-tab-submenu ol ol {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  margin-top: 4px !important;
  margin-bottom: 4px !important;
  margin-left: 10px !important;
  padding-left: 10px !important;
  border-left: 2px solid #cbd5e1 !important;
}

.wma-toc-wrapper li,
.gj-tab-submenu li,
.wma-toc-item,
li.wma-toc-item,
#gj-article-tabs-wrapper .gj-tab-submenu li,
#gj-article-tabs-wrapper .qodef-tabs-navigation li {
  list-style: none !important;
  list-style-type: none !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Restrict TOC item rendering strictly to rendered-depth 2 and 3 */
.wma-toc-item[data-rendered-depth]:not([data-rendered-depth="2"]):not([data-rendered-depth="3"]),
.gj-tab-submenu .wma-toc-item[data-rendered-depth]:not([data-rendered-depth="2"]):not([data-rendered-depth="3"]),
.wasabi-sidebar-toc-container .wma-toc-item[data-rendered-depth]:not([data-rendered-depth="2"]):not([data-rendered-depth="3"]) {
  display: none !important;
}

.wma-toc-wrapper li::before,
.wma-toc-wrapper li::after,
.wma-toc-list li::before,
.wma-toc-list li::after,
.gj-tab-submenu li::before,
.gj-tab-submenu li::after,
.wma-toc-item::before,
.wma-toc-item::after,
#gj-article-tabs-wrapper .gj-tab-submenu li::before,
#gj-article-tabs-wrapper .gj-tab-submenu li::after,
#gj-article-tabs-wrapper .qodef-tabs-navigation li::before,
#gj-article-tabs-wrapper .qodef-tabs-navigation li::after {
  content: none !important;
  display: none !important;
}

/* Base TOC Links */
.wma-toc-wrapper a,
.wma-toc-list a,
.gj-tab-submenu a,
.gj-tab-submenu .wma-toc-list a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a {
  text-transform: none !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: visible !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  display: block !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 6px !important;
  transition: color 0.18s ease, background-color 0.18s ease !important;
}

/* Depth 1: Main Parent Headings */
.gj-tab-submenu .wma-toc-depth-1 > a,
.wma-toc-wrapper .wma-toc-depth-1 > a,
.wma-toc-item.wma-toc-depth-1 > a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-depth-1 > a {
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 10px !important;
  color: #334155 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

/* Depth 2: Sub-headings (First Child Level) */
.gj-tab-submenu .wma-toc-depth-2 > a,
.wma-toc-wrapper .wma-toc-depth-2 > a,
.wma-toc-item.wma-toc-depth-2 > a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-depth-2 > a {
  font-size: 12px !important;
  font-weight: 450 !important;
  padding: 5px 10px !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-radius: 5px !important;
  box-shadow: none !important;
}

/* Depth 3 & 4: Deep Sub-headings */
.gj-tab-submenu .wma-toc-depth-3 > a,
.gj-tab-submenu .wma-toc-depth-4 > a,
.wma-toc-wrapper .wma-toc-depth-3 > a,
.wma-toc-wrapper .wma-toc-depth-4 > a,
.wma-toc-item.wma-toc-depth-3 > a,
.wma-toc-item.wma-toc-depth-4 > a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-depth-3 > a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-depth-4 > a {
  font-size: 11.5px !important;
  font-weight: 400 !important;
  padding: 4px 8px !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

/* Hover & Active States with reference-style ::before width expand effect */
.gj-tab-submenu .wma-toc-list a,
.wma-toc-wrapper .wma-toc-list a,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a {
  position: relative !important;
  overflow: hidden !important;
  z-index: 1 !important;
  transition: all 0.4s ease !important;
  border: none !important;
  border-left: none !important;
}

.gj-tab-submenu .wma-toc-list a::after,
.wma-toc-wrapper .wma-toc-list a::after,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: #eeeeee61 !important;
  z-index: -2 !important;
  border-radius: inherit !important;
}

.gj-tab-submenu .wma-toc-list a::before,
.wma-toc-wrapper .wma-toc-list a::before,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 7px !important;
  height: 100% !important;
  background-image: linear-gradient(271deg, #f3d3d34a, #e4f5f8) !important;
  border-radius: inherit !important;
  z-index: -1 !important;
  transition: width 0.4s ease, all 0.4s ease !important;
}

.gj-tab-submenu .wma-toc-list a:hover,
.wma-toc-wrapper .wma-toc-list a:hover,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a:hover {
  color: #0e202a !important;
  background: transparent !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.gj-tab-submenu .wma-toc-list a:hover::before,
.wma-toc-wrapper .wma-toc-list a:hover::before,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a:hover::before {
  width: 50px !important;
}

.gj-tab-submenu .wma-toc-list a.is-active-sub,
.wma-toc-wrapper .wma-toc-list a.is-active-sub,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a.is-active-sub {
  color: #0e202a !important;
  background: transparent !important;
  font-weight: 600 !important;
  border: none !important;
  border-left: none !important;
  transform: none !important;
}

.gj-tab-submenu .wma-toc-list a.is-active-sub::before,
.wma-toc-wrapper .wma-toc-list a.is-active-sub::before,
#gj-article-tabs-wrapper .gj-tab-submenu .wma-toc-list a.is-active-sub::before {
  width: 50px !important;
}

.wma-toc-wrapper mjx-container,
.wma-toc-list mjx-container,
.gj-tab-submenu mjx-container {
  display: inline-block !important;
  vertical-align: middle !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.wma-toc-wrapper svg,
.wma-toc-list svg,
.gj-tab-submenu svg {
  overflow: visible !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.wma-toc-wrapper a *,
.wma-toc-list a *,
.gj-tab-submenu a * {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.wma-toc-wrapper .math-fallback,
.wma-toc-list .math-fallback,
.gj-tab-submenu .math-fallback,
.wma-toc-wrapper .math-inline--native,
.wma-toc-list .math-inline--native,
.gj-tab-submenu .math-inline--native {
  text-transform: none !important;
  font-family: inherit !important;
  white-space: nowrap !important;
}

.wma-toc-wrapper .math-inline-text-fallback,
.wma-toc-list .math-inline-text-fallback,
.gj-tab-submenu .math-inline-text-fallback {
  display: none;
}

.wma-toc-wrapper .math-inline--native math,
.wma-toc-list .math-inline--native math,
.gj-tab-submenu .math-inline--native math {
  display: inline math !important;
  font-size: 1em;
  color: inherit !important;
}

@supports not (display: inline math) {

  .wma-toc-wrapper .math-inline--native math,
  .wma-toc-list .math-inline--native math,
  .gj-tab-submenu .math-inline--native math {
    display: none !important;
  }

  .wma-toc-wrapper .math-inline-text-fallback,
  .wma-toc-list .math-inline-text-fallback,
  .gj-tab-submenu .math-inline-text-fallback {
    display: inline !important;
  }
}

.wma-toc-debug {
  margin: 0 0 12px !important;
  padding: 12px 14px !important;
  border: 1px solid #f59e0b !important;
  border-radius: 10px !important;
  background: #fff8e1 !important;
  color: #111827 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  text-transform: none !important;
}

.wma-toc-debug strong,
.wma-toc-debug summary,
.wma-toc-debug code,
.wma-toc-debug pre,
.wma-toc-debug li,
.wma-toc-debug span {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.wma-toc-debug-list {
  list-style: none !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
}

.wma-toc-debug-list li {
  display: flex !important;
  gap: 8px !important;
  align-items: flex-start !important;
  margin: 4px 0 !important;
}

.wma-toc-debug-key {
  min-width: 140px;
  font-weight: 700;
}

.wma-toc-debug code {
  white-space: normal !important;
  word-break: break-word !important;
}

.wma-toc-debug-details {
  margin-top: 10px !important;
}

.wma-toc-debug pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0 !important;
  padding: 10px !important;
  border-radius: 8px !important;
  background: #111827 !important;
  color: #f9fafb !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

/* ─── Citation Reference & Footnote Hovercard Tooltip ─── */
.gj-citation-hovercard {
  display: none;
  position: fixed;
  z-index: 9999999;
  width: 360px;
  max-width: calc(100vw - 28px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 4px 10px rgba(0, 0, 0, 0.04);
  padding: 13px 15px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.gj-citation-hovercard.is-visible {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Invisible Hover Bridge to eliminate dead-zone between trigger and hovercard */
.gj-citation-hovercard::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: auto;
  background: transparent;
}
.gj-citation-hovercard[data-placement="top"]::before {
  bottom: -16px;
}
.gj-citation-hovercard[data-placement="bottom"]::before {
  top: -16px;
}
.gj-citation-hovercard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f1f5f9;
}
.gj-citation-hovercard-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f9ff;
  color: #0284c7;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gj-citation-hovercard-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}
.gj-citation-hovercard-body {
  color: #334155;
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 8px;
  max-height: 180px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  word-wrap: break-word !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
  box-sizing: border-box;
  padding-right: 4px;
}
.gj-citation-hovercard-body * {
  max-width: 100% !important;
  word-wrap: break-word !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
  box-sizing: border-box;
}
.gj-citation-hovercard-body p {
  margin: 0 0 6px 0;
  line-height: 1.55;
}
.gj-citation-hovercard-body p:last-child {
  margin-bottom: 0;
}
.gj-citation-hovercard-body em {
  color: #0f172a;
  font-style: italic;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
.gj-citation-hovercard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
  flex-wrap: wrap;
}
.gj-citation-hovercard-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0284c7 !important;
  font-weight: 600;
  text-decoration: none !important;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.gj-citation-hovercard-link:hover {
  background: #f0f9ff;
  color: #0369a1 !important;
}
.gj-citation-hovercard-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b !important;
  font-weight: 500;
  text-decoration: none !important;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 11.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.gj-citation-hovercard-jump:hover {
  background: #f8fafc;
  color: #1e293b !important;
}

/* Dark mode for Citation Hovercard */
body.dark-scheme .gj-citation-hovercard,
.dark-mode .gj-citation-hovercard {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(71, 85, 105, 0.85);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
}
body.dark-scheme .gj-citation-hovercard-header,
.dark-mode .gj-citation-hovercard-header {
  border-bottom-color: #334155;
}
body.dark-scheme .gj-citation-hovercard-badge,
.dark-mode .gj-citation-hovercard-badge {
  background: #0f172a;
  color: #38bdf8;
}
body.dark-scheme .gj-citation-hovercard-body,
.dark-mode .gj-citation-hovercard-body {
  color: #cbd5e1;
}
body.dark-scheme .gj-citation-hovercard-body em,
.dark-mode .gj-citation-hovercard-body em {
  color: #f8fafc;
}
body.dark-scheme .gj-citation-hovercard-actions,
.dark-mode .gj-citation-hovercard-actions {
  border-top-color: #334155;
}
body.dark-scheme .gj-citation-hovercard-link,
.dark-mode .gj-citation-hovercard-link {
  color: #38bdf8 !important;
}
body.dark-scheme .gj-citation-hovercard-link:hover,
.dark-mode .gj-citation-hovercard-link:hover {
  background: #0f172a;
}
body.dark-scheme .gj-citation-hovercard-jump,
.dark-mode .gj-citation-hovercard-jump {
  color: #94a3b8 !important;
}
body.dark-scheme .gj-citation-hovercard-jump:hover,
.dark-mode .gj-citation-hovercard-jump:hover {
  background: #334155;
  color: #f8fafc !important;
}

/* ─── Universal In-Page Anchor Smooth Target Offset & Target Highlight ─── */
:target,
[id],
.markdown-body [id],
.wasabi-article-markdown-wrapper [id],
.wma-article [id],
.wma-rendered-layout [id],
[id^="eq-"],
[id^="fig-"],
[id^="tbl-"],
[id^="fn-"],
[id^="ref-"],
[id^="sec-"],
.math-display,
.figure,
.table-wrap,
table,
.footnotes li,
section.footnotes li,
.scholarly-references li,
.sad-s3-refs-list li {
  scroll-margin-top: 110px !important;
}

@media (max-width: 1024px) {
  :target,
  [id],
  .markdown-body [id],
  .wasabi-article-markdown-wrapper [id],
  .wma-article [id],
  .wma-rendered-layout [id],
  [id^="eq-"],
  [id^="fig-"],
  [id^="tbl-"],
  [id^="fn-"],
  [id^="ref-"],
  [id^="sec-"],
  .math-display,
  .figure,
  .table-wrap,
  table,
  .footnotes li,
  section.footnotes li,
  .scholarly-references li,
  .sad-s3-refs-list li {
    scroll-margin-top: 90px !important;
  }
}

/* Gentle Target Pulse ring when jumped via anchor link */
.gj-target-highlight {
  animation: gjTargetPulse 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes gjTargetPulse {
  0% {
    outline: 2.5px solid #0284c7;
    outline-offset: 3px;
    background-color: rgba(2, 132, 199, 0.12);
    border-radius: 4px;
  }
  60% {
    outline: 2px solid rgba(2, 132, 199, 0.45);
    outline-offset: 3px;
    background-color: rgba(2, 132, 199, 0.06);
  }
  100% {
    outline: 2px solid transparent;
    outline-offset: 0;
    background-color: transparent;
  }
}

/* ==========================================================================
   Mobile Article Title Truncation (6-7 words / 2 lines + Expand Toggle)
   ========================================================================== */
.gj-article-title-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.gj-article-title-toggle {
  display: none !important;
}

@media (max-width: 767px) {
  .gj-article-title-wrap.is-collapsible .gj-article-title-heading {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.35em !important;
    cursor: pointer;
  }

  .gj-article-title-wrap.is-collapsible.is-expanded .gj-article-title-heading {
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
  }

  .gj-article-title-wrap.is-collapsible .gj-article-title-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    margin-top: 6px !important;
    padding: 2px 7px !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-size: 6px !important;
    cursor: pointer !important;
    line-height: 1 !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    transition: background-color 0.2s ease, transform 0.2s ease !important;
  }

  .gj-article-title-wrap.is-collapsible .gj-article-title-toggle:hover,
  .gj-article-title-wrap.is-collapsible .gj-article-title-toggle:active {
    background: rgba(255, 255, 255, 0.3) !important;
  }

  .gj-article-title-toggle .gj-title-toggle-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.25s ease !important;
  }

  .gj-article-title-wrap.is-expanded .gj-article-title-toggle .gj-title-toggle-icon {
    transform: rotate(180deg) !important;
  }

  .gj-article-title-toggle .gj-title-toggle-text {
    font-size: 6px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    opacity: 0.9 !important;
  }
}

@media (min-width: 768px) {
  .gj-article-title-toggle {
    display: none !important;
  }
  .gj-article-title-heading {
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
  }
}