/* Feature styles on top of assets/theme.css. */
:root {
  --sidebar-toggle-height: 40px;
  --sidebar-toggle-margin-block: 0;
  --sidebar-toggle-width: 36px;
  --sidebar-toggle-alignment: flex-start;
  --navbar-height: 3.25rem;
  --navbar-font-size: 0.9rem;
  --navbar-link-color: var(--sidebar-link-color);
  --navbar-link-color-active: var(--sidebar-name-color);
  --navbar-drop-link-spacing: 0.15rem;
  --scroll-padding-top: calc(var(--navbar-height) + 0.5rem);
}

html {
  scroll-padding-top: var(--scroll-padding-top);
}

/* Hide Docsify GitHub corner if a repo option is re-added later. */
.github-corner {
  display: none !important;
}

/* Sidebar: layout */
.sidebar-nav ul ul,
.sidebar-nav a {
  font-size: inherit;
}

/* Sidebar: group titles (non-clickable labels). Yellow is for headers, not links. */
.sidebar-nav > p,
.sidebar-nav li > p:not(:has(a)),
.sidebar-nav li.group > p.group-title {
  margin: 0.85em 0 0.3em;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-color);
  cursor: default;
  line-height: 1.3;
}
.sidebar-nav > ul > li > p:not(:has(a)),
.sidebar-nav > ul > li.group > p.group-title {
  margin: 1.1em 0 0.35em;
}
.sidebar-nav > ul > li:has(> a) + li:has(> p:not(:has(a))),
.sidebar-nav > ul > li:has(> p > a) + li:has(> p:not(:has(a))) {
  margin-top: 1.25rem;
  padding-top: 0.35rem;
}

/* Types sidebar: `---` + `# Types` section banner. */
.sidebar-nav > h1 {
  margin: 0.85em 20px 0.35em;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-color);
  line-height: 1.3;
}
.sidebar-nav > h1 a.anchor,
.sidebar-nav > h1 a.anchor:hover,
.sidebar-nav > h1 a.anchor:focus {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}
.sidebar-nav > h1 a.anchor span {
  color: inherit;
}
.sidebar-nav > hr {
  margin: 1.25rem 20px 0.35rem;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--theme-color) 35%, var(--sidebar-border-color));
  background: transparent;
  height: 0;
}

/* Sidebar: links */
.sidebar a[href],
.sidebar a[href]:hover,
.sidebar a[href]:focus {
  text-decoration: none;
  text-decoration-color: transparent;
  translate: none;
}
.sidebar .sidebar-nav a[href]:hover,
.sidebar .sidebar-nav a[href]:focus-visible {
  color: var(--sidebar-name-color);
}
.sidebar .sidebar-nav li.active > a.page-link:hover,
.sidebar .sidebar-nav li.active > p > a.page-link:hover {
  color: var(--sidebar-name-color);
}
.sidebar .sidebar-nav button.smt-sidebar-group-toggle:hover {
  color: var(--link-color-hover);
}
.sidebar-nav a[href^="http"]::after,
.markdown-section a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
}

/* Sidebar: active page. Gold left border is in theme.css. */
.sidebar-nav li.active > a,
.sidebar-nav li.active > p > a,
.sidebar-nav li.active > a.page-link,
.sidebar-nav li.active > p > a.page-link {
  color: var(--sidebar-name-color);
  font-weight: 600;
}
.sidebar-nav li.active li:not(.active) > a,
.sidebar-nav li.active li:not(.active) > p > a,
.sidebar-nav li.active li:not(.active) > a.page-link,
.sidebar-nav li.active li:not(.active) > p > a.page-link {
  color: var(--sidebar-link-color);
  font-weight: inherit;
}

/* Sidebar: collapse chevron.
 * Docsify styles `button[type]` as a pill; reset that here. */
.sidebar-nav > ul > li.group > p.group-title {
  display: flex;
  align-items: center;
  margin: 0.35em 0 0.15em;
  margin-left: calc(-0.55em - 0.3em);
}
.sidebar-nav button.smt-sidebar-group-toggle {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.3em;
  width: 100%;
  cursor: pointer;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.sidebar-nav button.smt-sidebar-group-toggle:focus {
  outline: none;
}
.sidebar-nav button.smt-sidebar-group-toggle:hover,
.sidebar-nav button.smt-sidebar-group-toggle:active {
  outline: none;
  background: transparent;
  box-shadow: none;
  filter: none;
}
.sidebar-nav button.smt-sidebar-group-toggle:focus-visible {
  outline: 2px solid var(--border-color);
  outline-offset: 2px;
}
.smt-sidebar-group-chevron {
  display: block;
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  background: currentColor;
  clip-path: polygon(15% 25%, 50% 75%, 85% 25%);
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform var(--duration-medium, 250ms) ease;
}
.sidebar-nav > ul > li.group.smt-sidebar-group-closed > p .smt-sidebar-group-chevron {
  transform: rotate(-90deg);
}
.sidebar-nav > ul > li.group.smt-sidebar-section-hidden {
  display: none;
}
.sidebar-nav > ul > li.group.smt-sidebar-section-hide-title > p.group-title {
  display: none;
}
.sidebar-nav > ul > li.group.smt-sidebar-section-current > ul {
  display: block;
  margin-top: 0;
}

nav.app-nav {
  position: fixed;
  top: 0;
  color: var(--color-text);
  background: color-mix(in srgb, var(--sidebar-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-sizing: border-box;
  padding-inline: 1rem;
  overflow: visible;
}
nav.app-nav > ul {
  align-items: center;
  gap: 0.15rem;
}
nav.app-nav > ul > li {
  display: inline-flex;
  align-items: center;
  color: var(--sidebar-link-color);
  font-size: var(--navbar-font-size);
  font-weight: 500;
  letter-spacing: 0.01em;
}
nav.app-nav > ul > li > a,
nav.app-nav > ul > li > span,
nav.app-nav > ul > li > p {
  color: inherit;
  text-decoration: none;
  text-decoration-color: transparent;
  padding: 0.4rem 0.75rem;
  border-radius: 0;
  line-height: 1.2;
}
nav.app-nav > ul > li:not(:has(> a)) {
  padding: 0.4rem 0.75rem;
  border-radius: 0;
}
nav.app-nav > ul > li:has(> ul)::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: -0.35rem;
  margin-right: 0.45rem;
  background: currentColor;
  clip-path: polygon(15% 25%, 50% 75%, 85% 25%);
  opacity: 0.7;
}
nav.app-nav > ul > li.active > a,
nav.app-nav > ul > li.smt-nav-current > a,
nav.app-nav > ul > li > a.active {
  color: var(--sidebar-name-color);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 2px solid var(--theme-color);
  text-decoration: none;
  text-decoration-color: transparent;
}
nav.app-nav a[href]:hover,
nav.app-nav a[href]:focus-visible,
nav.app-nav > ul > li:not(:has(> a)):hover {
  color: var(--sidebar-name-color);
  text-decoration: none;
  text-decoration-color: transparent;
}
nav.app-nav > ul > li > a:hover,
nav.app-nav > ul > li:not(:has(> a)):hover {
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
}
nav.app-nav a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
}
nav.app-nav li ul {
  min-width: 15rem;
  padding: 0.4rem;
  border: 1px solid var(--smt-card-border);
  border-radius: 8px;
  background: var(--smt-card-bg);
  box-shadow: 0 10px 28px rgb(0 0 0 / 45%);
}
nav.app-nav li ul a {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--sidebar-link-color);
}
nav.app-nav li ul a:hover,
nav.app-nav li ul a:focus-visible {
  color: var(--sidebar-name-color);
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
}

.sidebar-nav > ul > li.group.smt-sidebar-group-closed > ul {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .smt-sidebar-group-chevron {
    transition: none;
  }
}

/* Sidebar: mobile drawer and toggle */
.sidebar-toggle,
.sidebar-toggle:hover,
.sidebar-toggle:focus,
.sidebar-toggle:focus-visible,
.sidebar-toggle:active {
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  outline: none !important;
  background: transparent !important;
}
.sidebar-toggle {
  padding: max(0.65rem, env(safe-area-inset-top, 0px)) 0 0 0;
  box-sizing: border-box;
}
.sidebar-toggle .sidebar-toggle-button {
  color: var(--sidebar-toggle-color);
  border: 0;
  border-radius: 0;
  outline: none;
  background: var(--sidebar-bg);
}
.sidebar-toggle .sidebar-toggle-button .smt-sidebar-toggle-icon {
  display: block;
  transform: rotate(0deg);
  transform-origin: center;
  transition: transform var(--duration-medium, 250ms) ease;
}
body:has(.sidebar.show) .sidebar-toggle .smt-sidebar-toggle-icon {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-toggle .sidebar-toggle-button .smt-sidebar-toggle-icon {
    transition: none;
  }
}
.sidebar-toggle .sidebar-toggle-button:focus-visible {
  outline: 2px solid var(--border-color);
  outline-offset: 2px;
  box-shadow: none;
}
.sidebar-toggle .sidebar-toggle-button:focus:not(:focus-visible) {
  outline: none;
}
@media screen and (any-hover) {
  body:where(:has(.sidebar-toggle:hover)) .sidebar-toggle-button:not(:hover) {
    color: var(--sidebar-toggle-color);
    background: var(--sidebar-bg);
  }
  .sidebar-toggle .sidebar-toggle-button:hover {
    color: var(--sidebar-link-color);
    background: color-mix(in srgb, var(--color-text) 8%, var(--sidebar-bg));
    outline: none;
    box-shadow: none;
  }
  .sidebar-toggle .sidebar-toggle-button:active {
    background: color-mix(in srgb, var(--color-text) 14%, var(--sidebar-bg));
    outline: none;
  }
}
#smt-drawer-scrim {
  display: none;
}
@media screen and (max-width: 640px) {
  #smt-drawer-scrim {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width);
    z-index: 45;
    background: transparent;
    cursor: pointer;
  }
  body.smt-drawer-open .sidebar {
    padding-top: calc(
      max(0.65rem, env(safe-area-inset-top, 0px)) + var(--sidebar-toggle-height) + 0.4rem
    );
  }
  body.smt-drawer-open .sidebar-toggle {
    position: fixed;
    left: max(0px, env(safe-area-inset-left, 0px));
    top: calc(max(0.65rem, env(safe-area-inset-top, 0px)));
    right: auto;
    bottom: auto;
    width: auto !important;
    height: auto;
    padding: 0;
    translate: none !important;
    z-index: 61;
    align-items: flex-start;
    animation: smt-drawer-close-btn-in var(--duration-medium, 250ms) ease forwards;
  }
}
@keyframes smt-drawer-close-btn-in {
  from {
    transform: translateX(calc(0px - var(--sidebar-width)));
  }
  to {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  body.smt-drawer-open .sidebar-toggle {
    animation: none !important;
    transform: none !important;
  }
}

@media (min-width: 1100px) {
  .markdown-section :is(h1, h2, h3, h4, h5, h6) {
    scroll-margin-top: calc(var(--navbar-height, 4em) + 0.75rem);
  }
}

/* Prose links: no underline. */
.markdown-section :not(pre) a:not(.button):not(.anchor) {
  color: var(--link-color, var(--theme-color));
  text-decoration: none;
}
@media screen and (any-hover) {
  .markdown-section :not(pre) a:not(.button):not(.anchor):hover {
    color: var(--theme-color);
    text-decoration: none;
  }
}

/* In-page table of contents: after the page h1, not nested under that title. */
#smt-page-toc {
  margin: 0 0 1.5rem;
  padding: 0;
  background: none;
  border: 0;
}
#smt-page-toc .smt-page-toc-title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading-color, #f0f0f0);
}
#smt-page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#smt-page-toc li {
  margin: 0.12rem 0;
  padding: 0;
  line-height: 1.4;
}
#smt-page-toc ul ul {
  margin: 0.1rem 0 0.15rem;
  padding-left: 0.85rem;
}
#smt-page-toc a.smt-page-toc-link {
  color: var(--link-color, var(--theme-color));
  text-decoration: none;
}
@media screen and (any-hover) {
  #smt-page-toc a.smt-page-toc-link:hover {
    color: var(--theme-color);
    text-decoration: none;
  }
}
#smt-page-toc a.smt-page-toc-active {
  font-weight: 600;
  color: var(--heading-color, #f0f0f0);
}

/* Heading permalink: icon sits next to title (not full-width space-between). */
.markdown-section :is(h1, h2, h3, h4, h5, h6).smt-heading-with-anchor {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.35em;
  overflow: visible;
}

.markdown-section :is(h1, h2, h3).smt-heading-active,
.markdown-section :is(h1, h2, h3).smt-heading-active .smt-heading-text {
  color: var(--theme-color);
}
.markdown-section .smt-heading-text {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.markdown-section .smt-member-path {
  margin: -0.15rem 0 0.85rem;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.markdown-section .smt-member-path code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}
.markdown-section .smt-heading-copy {
  position: relative;
  overflow: visible;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0;
  padding: 0.2rem;
  border: 0;
  border-radius: var(--border-radius, 3px);
  background: transparent;
  color: color-mix(in srgb, var(--heading-color, var(--strong-color)) 55%, var(--theme-color) 45%);
  cursor: pointer;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-fast, 150ms) ease,
    color var(--duration-fast, 150ms) ease,
    background var(--duration-fast, 150ms) ease;
}
@media (hover: none) {
  .markdown-section .smt-heading-copy {
    opacity: 0.55;
    pointer-events: auto;
  }
}
.markdown-section .smt-heading-copy.smt-heading-copy-feedback {
  opacity: 1;
  pointer-events: auto;
}
.markdown-section .smt-heading-copy,
.markdown-section .smt-heading-copy * {
  cursor: pointer;
}
.markdown-section .smt-heading-copy-icon {
  display: block;
  flex-shrink: 0;
  shape-rendering: geometricPrecision;
}
.markdown-section :is(h1, h2, h3, h4, h5, h6).smt-heading-with-anchor:hover .smt-heading-copy,
.markdown-section
  :is(h1, h2, h3, h4, h5, h6).smt-heading-with-anchor:focus-within
  .smt-heading-copy {
  opacity: 0.55;
  pointer-events: auto;
}
.markdown-section :is(h1, h2, h3, h4, h5, h6).smt-heading-with-anchor:hover .smt-heading-copy:hover,
.markdown-section
  :is(h1, h2, h3, h4, h5, h6).smt-heading-with-anchor:focus-within
  .smt-heading-copy:hover {
  opacity: 1;
  color: var(--theme-color);
  background: color-mix(in srgb, var(--theme-color) 14%, var(--color-bg, #fff));
}
.markdown-section .smt-heading-copy:active {
  background: color-mix(in srgb, var(--theme-color) 22%, var(--color-bg, #fff));
  opacity: 1;
}
.markdown-section .smt-heading-copy:focus-visible {
  outline: 2px solid var(--border-color, rgba(0, 0, 0, 0.22));
  outline-offset: 2px;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .markdown-section .smt-heading-copy {
    transition: none;
  }
}

/* "Copied" tooltip: absolutely positioned above the copy button (child of button). */
.smt-heading-copy-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 20;
  box-sizing: border-box;
  margin: 0;
  padding: 0.35em 0.65em;
  font-family: var(--font-family, system-ui, sans-serif);
  font-size: var(--font-size-xs, 12px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-bg, #fff);
  background: color-mix(in srgb, var(--color-text, #222) 88%, var(--color-bg, #fff) 12%);
  border-radius: var(--border-radius, 4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  animation: smt-heading-copy-tooltip 2.1s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .smt-heading-copy-tooltip {
    animation: smt-heading-copy-tooltip-rm 1.6s ease forwards;
  }
}
@keyframes smt-heading-copy-tooltip {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
}
/* TypeDoc API signatures (blockquote → ```ts fences in docs:api output). */
.markdown-section :is(h3, h4, h5, h6) + pre:has(> code.language-ts) {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--blockquote-bg, var(--code-inline-bg));
  border-left: 3px solid var(--theme-color);
  border-radius: 0 4px 4px 0;
  overflow-x: auto;
}

.markdown-section :is(h3, h4, h5, h6) + pre:has(> code.language-ts) code {
  background: transparent;
  padding: 0;
  font-size: 0.9em;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes smt-heading-copy-tooltip-rm {
  0% {
    opacity: 0;
    transform: translateX(-50%);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%);
  }
  78% {
    opacity: 1;
    transform: translateX(-50%);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%);
  }
}

/* Tables: Docsify stripes tr:nth-child(2n); with thead/tbody the header and first body row are both odd and look identical. */
.markdown-section thead th {
  background: var(--table-header-bg);
  border-bottom-width: 2px;
}
.markdown-section thead tr:nth-child(2n) {
  background: var(--table-header-bg);
}
.markdown-section tbody tr:nth-child(odd) {
  background: transparent;
}
.markdown-section tbody tr:nth-child(2n) {
  background: var(--table-row-alt-bg);
}

/* Doc screenshots and figures */
.markdown-section img {
  display: block;
  max-width: min(100%, 42rem);
  height: auto;
  margin-block: 1rem;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.18));
  border-radius: 6px;
}

.smt-search-page {
  margin: 0 0 2rem;
}

.smt-search-page .smt-search-label {
  display: block;
  margin: 0 0 0.45rem;
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--smt-muted-text, #9a9a9a);
}

.smt-search-page .smt-search-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--smt-card-border, var(--border-color));
  border-radius: 6px;
  background: var(--smt-card-bg, #1e1e1e);
  color: var(--heading-color, #f0f0f0);
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 1rem;
}

.smt-search-page .smt-search-field input:focus {
  outline: 2px solid var(--link-color, #ff9900);
  outline-offset: 2px;
}

.smt-search-page .smt-search-field input::-webkit-search-decoration,
.smt-search-page .smt-search-field input::-webkit-search-cancel-button {
  appearance: none;
}

.smt-search-page .smt-search-hint {
  margin: 0.55rem 0 0.85rem;
  color: var(--smt-muted-text, #9a9a9a);
  font-size: 0.82rem;
}

.smt-search-page kbd {
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--smt-card-border, #2a2a2a);
  border-radius: 3px;
  background: var(--code-bg, #202020);
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.78em;
}

.smt-search-page .smt-search-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.smt-search-page .smt-search-settings-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--smt-muted-text);
  font-size: 0.85rem;
  line-height: 1.35;
  cursor: pointer;
}

.smt-search-page .smt-search-settings-row input {
  flex: 0 0 auto;
  margin: 0.15rem 0 0;
  accent-color: var(--theme-color);
}

.smt-search-page .smt-search-scope {
  margin: 0;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--smt-card-border, #2a2a2a);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text, #ddd);
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  cursor: pointer;
}

.smt-search-page .smt-search-scope[aria-pressed="true"] {
  border-color: var(--link-color, #ff9900);
  background: color-mix(in srgb, var(--link-color, #ff9900) 16%, transparent);
  color: var(--heading-color, #f0f0f0);
}

.smt-search-page .smt-search-status {
  margin: 0 0 0.75rem;
  color: var(--smt-muted-text, #9a9a9a);
  font-size: 0.85rem;
}

.smt-search-page .smt-search-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.smt-search-page .smt-search-hit {
  margin: 0;
  padding: 0;
  list-style: none;
}

.smt-search-page .smt-search-hit-link {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--smt-card-border, var(--border-color));
  border-radius: 6px;
  background: var(--smt-card-bg, #1e1e1e);
  color: inherit;
  text-decoration: none;
}

.smt-search-page .smt-search-hit-link:hover,
.smt-search-page .smt-search-hit-link.is-active,
.smt-search-page .smt-search-hit-link:focus-visible {
  border-color: var(--smt-card-hover-border, var(--link-color));
  text-decoration: none;
}

.markdown-section .smt-search-page .smt-search-hit-link,
.markdown-section .smt-search-page .smt-search-hit-link:hover {
  color: inherit;
  text-decoration: none;
}

.smt-search-page .smt-search-hit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.smt-search-page .smt-search-hit-title {
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--heading-color, #f0f0f0);
  overflow-wrap: anywhere;
}

.smt-search-page .smt-search-hit-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--smt-muted-text, #9a9a9a);
}

.smt-search-page .smt-search-hit-desc {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}

.smt-search-page mark {
  background: color-mix(in srgb, var(--theme-color) 35%, transparent);
  color: inherit;
  padding: 0 0.1em;
}

.smt-search-page .smt-api-badge {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.14rem 0.45rem;
  border-radius: 3px;
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.smt-search-page .smt-api-badge-worker {
  border: 1px solid color-mix(in srgb, var(--smt-worker-blue, #4a9eff) 55%, transparent);
  background: color-mix(in srgb, var(--smt-worker-blue, #4a9eff) 14%, transparent);
  color: var(--smt-worker-blue-soft, #7ec8ff);
}

.smt-search-browse {
  margin: 0 0 2rem;
}

.smt-search-browse h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading-color, #f0f0f0);
}

.smt-search-browse ul.smt-api-group.smt-api-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.smt-search-browse ul.smt-api-group > li.smt-api-card {
  margin: 0;
  padding: 0;
  min-width: 0;
  list-style: none;
}

.smt-search-browse .smt-api-card-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--smt-card-border, var(--border-color));
  border-radius: 8px;
  background: var(--smt-card-bg, #1e1e1e);
}

.smt-search-browse .smt-api-card-link {
  align-self: flex-start;
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-weight: 700;
  color: var(--heading-color, #f0f0f0);
  text-decoration: none;
}

.markdown-section .smt-search-browse .smt-api-card-link,
.markdown-section .smt-search-browse .smt-api-card-link:hover {
  color: var(--heading-color, #f0f0f0);
  text-decoration: none;
}

@media screen and (any-hover) {
  .smt-search-browse .smt-api-card-panel:hover {
    border-color: var(--smt-card-hover-border, var(--link-color));
    background: color-mix(in srgb, var(--theme-color) 8%, var(--smt-card-bg, #1e1e1e));
  }

  .smt-search-browse .smt-api-card-link:hover {
    color: var(--theme-color);
  }
}

.smt-search-browse .smt-api-card-desc {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 400;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

.smt-search-browse .smt-api-card-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.smt-search-browse .smt-api-card-children li {
  margin: 0;
  padding: 0;
}

.smt-search-browse .smt-api-card-child {
  display: inline;
  font-family: var(--smt-font-mono, ui-monospace, monospace);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Sandkit API module index: grouped namespace chips. */
.smt-api-landing {
  line-height: 1.6;
}

.smt-api-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.14));
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-color) 6%, var(--color-bg, #fff));
  font-size: 0.92rem;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}

.smt-api-stats strong {
  color: var(--heading-color, var(--color-text));
  font-weight: 700;
}

.smt-api-landing h1 {
  margin-block: 0 0.55em;
}

.smt-api-landing h2 {
  margin-block: 1.5em 0.55em;
}

.smt-api-landing h3 {
  margin-block: 1.1em 0.4em;
  font-weight: 600;
  color: var(--heading-color, var(--color-text));
}

.smt-api-landing > p {
  margin-block: 0 1em;
}

.smt-api-landing > ul {
  line-height: 1.75;
  margin-block: 0.35em 1.1em;
}

.smt-api-landing > ul > li {
  margin-block: 0.28em;
}

.smt-api-landing ul.smt-api-group.smt-api-cards {
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.smt-api-landing ul.smt-api-group > li.smt-api-card {
  margin: 0;
  padding: 0;
  list-style: none;
}

.smt-api-landing .smt-api-card-link {
  display: block;
  height: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.14));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text, #333) 4%, var(--color-bg, #fff));
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--duration-fast, 150ms) ease,
    background var(--duration-fast, 150ms) ease;
}

@media screen and (any-hover) {
  .smt-api-landing .smt-api-card-link:hover {
    border-color: color-mix(in srgb, var(--theme-color) 55%, var(--border-color, #ccc));
    background: color-mix(in srgb, var(--theme-color) 8%, var(--color-bg, #fff));
    text-decoration: none;
  }
}

.smt-api-landing .smt-api-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.smt-api-landing .smt-api-card-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  color: var(--heading-color, var(--color-text));
}

.smt-api-landing .smt-api-card-meta {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
}

.smt-api-landing .smt-api-card-desc {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 400;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

.smt-api-landing .smt-api-badge {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.smt-api-landing .smt-api-badge-worker {
  border: 1px solid color-mix(in srgb, #38bdf8 35%, transparent);
  background: color-mix(in srgb, #38bdf8 12%, transparent);
  color: #7dd3fc;
}

.smt-api-landing ul.smt-api-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  align-items: start;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 0 0 1.15em;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.14));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-text, #333) 4%, var(--color-bg, #fff));
  line-height: 1.5;
}

.smt-api-landing ul.smt-api-group > li {
  margin: 0;
  padding: 0.18rem 0;
}

.smt-api-landing ul.smt-api-group > li > a {
  font-weight: 600;
}

.smt-api-landing ul.smt-api-tree {
  list-style: none;
  margin: 0.05rem 0 0.15rem;
  padding: 0 0 0 0.15rem;
}

.smt-api-landing ul.smt-api-tree li {
  position: relative;
  margin: 0;
  padding: 0.02rem 0 0.02rem 0.95rem;
}

.smt-api-landing ul.smt-api-tree li::before,
.smt-api-landing ul.smt-api-tree li::after {
  content: "";
  position: absolute;
  background: color-mix(in srgb, var(--color-text, #ddd) 38%, transparent);
  pointer-events: none;
}

/* Vertical stem */
.smt-api-landing ul.smt-api-tree li::after {
  left: 0.28rem;
  top: 0;
  bottom: 0;
  width: 1px;
}

/* Horizontal elbow */
.smt-api-landing ul.smt-api-tree li::before {
  left: 0.28rem;
  top: 0.78em;
  width: 0.55rem;
  height: 1px;
}

/* Last child: stem stops at the elbow */
.smt-api-landing ul.smt-api-tree li:last-child::after {
  bottom: auto;
  height: 0.78em;
}

.smt-api-landing ul.smt-api-tree a {
  font-weight: 500;
}

body.smt-okf-viewer-page .content {
  max-width: none;
  padding-top: var(--navbar-height, 3.25rem);
  padding-right: 0;
  padding-bottom: 0;
}
body.smt-okf-viewer-page .markdown-section {
  max-width: none;
  padding: 0;
  margin: 0;
  height: calc(100vh - var(--navbar-height, 3.25rem));
}
body.smt-okf-viewer-page .markdown-section > h1,
body.smt-okf-viewer-page .markdown-section > p,
body.smt-okf-viewer-page #smt-page-toc {
  display: none;
}

.smt-okf-viewer {
  height: 100%;
}
.smt-okf-status {
  margin: 1.5rem;
  color: var(--smt-muted-text, #9a9a9a);
}
.smt-okf-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--color-bg, #121212);
}
.smt-okf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.85rem;
  align-items: end;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color, #2a2a2a);
  background: var(--sidebar-bg, #1c1c1c);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.smt-okf-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--smt-muted-text, #9a9a9a);
}
.smt-okf-field input,
.smt-okf-field select,
.smt-okf-toolbar button {
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--heading-color, #f0f0f0);
  background: var(--form-element-bg, #202020);
  border: 1px solid var(--form-element-border-color, #2a2a2a);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  min-height: 2rem;
}
.smt-okf-field input {
  width: 12rem;
}
.smt-okf-toolbar button {
  cursor: pointer;
}
.smt-okf-toolbar button:hover {
  border-color: var(--smt-wiki-link, #ff9900);
}
.smt-okf-inline {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--smt-wiki-link, #ff9900);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.smt-okf-inline:hover {
  text-decoration: underline;
}
.smt-okf-count {
  margin: 0 0 0.15rem auto;
  font-size: 0.8rem;
  color: var(--smt-muted-text, #9a9a9a);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.smt-okf-main {
  display: flex;
  flex: 1;
  min-height: 0;
}
.smt-okf-graph {
  flex: 1 1 58%;
  min-width: 0;
  position: relative;
  z-index: 0;
  background: #161616;
}
.smt-okf-detail {
  flex: 0 0 42%;
  min-width: 18rem;
  overflow: auto;
  padding: 1rem 1.15rem 2rem;
  border-left: 1px solid var(--border-color, #2a2a2a);
  background: var(--color-bg, #121212);
}
.smt-okf-empty {
  margin-top: 2rem;
  text-align: center;
  color: var(--smt-muted-text, #9a9a9a);
}
.smt-okf-detail-head h1 {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.25rem;
  border: 0;
  padding: 0;
}
.smt-okf-chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #121212;
}
.smt-okf-chip-type {
  background: #2a2a2a;
  color: #f0f0f0;
}
.smt-okf-muted {
  color: var(--smt-muted-text, #9a9a9a);
  font-size: 0.85rem;
}
.smt-okf-open {
  font-weight: 600;
}
.smt-okf-meta {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.85rem 0 1.1rem;
  font-size: 0.9rem;
}
.smt-okf-meta dt {
  color: var(--smt-muted-text, #9a9a9a);
  font-weight: 600;
}
.smt-okf-meta dd {
  margin: 0;
}
.smt-okf-meta ul {
  margin: 0;
  padding-left: 1.1rem;
}
.smt-okf-tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: #202020;
  font-size: 0.75rem;
}
.smt-okf-body {
  font-size: 0.92rem;
}
.smt-okf-body > h1:first-child {
  display: none;
}
.smt-okf-backlinks {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #2a2a2a);
}
.smt-okf-backlinks h2 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}
@media (max-width: 900px) {
  body.smt-okf-viewer-page .markdown-section {
    height: auto;
  }
  .smt-okf-main {
    flex-direction: column;
  }
  .smt-okf-graph {
    min-height: 22rem;
  }
  .smt-okf-detail {
    flex: none;
    border-left: 0;
    border-top: 1px solid var(--border-color, #2a2a2a);
  }
  .smt-okf-count {
    margin-left: 0;
  }
}
