.spendware-api-reference-shell {
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--theia-color-border-subtle);
  border-radius: var(--theia-docs-radius-md);
  background: var(--theia-color-surface);
  box-shadow: var(--theia-docs-shadow-raised);
}

.md-main__inner.md-grid:has(.spendware-api-reference-shell) {
  max-width: 88rem;
}

.md-content__inner:has(.spendware-api-reference-shell) {
  margin-right: 0;
}

body:has(.spendware-api-reference-shell) .md-header {
  z-index: 20;
}

.spendware-api-reference-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--theia-color-border-subtle);
  background: color-mix(in srgb, var(--theia-color-brand-solid) 7%, var(--theia-color-surface));
}

.spendware-api-reference-kicker {
  margin: 0 0 0.15rem;
  color: var(--theia-color-brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.spendware-api-reference-title {
  margin: 0;
  color: var(--theia-color-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset .spendware-api-reference-link {
  flex: 0 0 auto;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--theia-color-border);
  border-radius: var(--theia-docs-radius-sm);
  color: var(--theia-color-brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  background: var(--theia-color-surface);
}

.md-typeset .spendware-api-reference-link:hover,
.md-typeset .spendware-api-reference-link:focus {
  color: var(--theia-color-brand);
  border-color: var(--theia-color-brand-soft-border);
  background: var(--theia-color-interactive-bg-hover);
}

.spendware-scalar-reference {
  min-height: 78vh;
  background: var(--theia-color-surface);
  --scalar-custom-header-height: var(--theia-docs-header-height);
  --scalar-font: var(--md-text-font-family);
  --scalar-font-code: var(--md-code-font-family);
  --scalar-radius: var(--theia-docs-radius-sm);
  --scalar-radius-lg: var(--theia-docs-radius-md);
  --scalar-color-1: var(--theia-color-text);
  --scalar-color-2: var(--theia-color-text-muted);
  --scalar-color-3: var(--theia-color-text-muted);
  --scalar-color-accent: var(--theia-color-brand);
  --scalar-color-disabled: var(--theia-color-icon-muted);
  --scalar-color-green: var(--theia-color-success);
  --scalar-color-orange: var(--theia-color-warning);
  --scalar-color-red: var(--theia-color-danger);
  --scalar-link-color: var(--theia-color-brand);
  --scalar-link-color-hover: var(--theia-color-brand);
  --scalar-link-color-visited: var(--theia-color-brand);
  --scalar-background-1: var(--theia-color-surface);
  --scalar-background-2: var(--theia-color-surface-muted);
  --scalar-background-3: var(--theia-color-surface-raised);
  --scalar-background-4: var(--theia-color-bg);
  --scalar-background-accent: var(--theia-color-brand-soft-bg);
  --scalar-background-card: var(--theia-color-surface);
  --scalar-border-color: var(--theia-color-border-subtle);
  --scalar-button-1: var(--theia-color-brand-solid);
  --scalar-button-1-color: var(--theia-color-brand-on-solid);
  --scalar-button-1-hover: color-mix(in srgb, var(--theia-color-brand-solid) 88%, #000000);
  --scalar-scrollbar-color: var(--theia-color-scrollbar-thumb);
  --scalar-scrollbar-color-active: var(--theia-color-scrollbar-thumb-hover);
  --scalar-header-background-1: var(--theia-color-surface);
  --scalar-header-background-2: var(--theia-color-surface-muted);
  --scalar-header-border-color: var(--theia-color-border-subtle);
  --scalar-header-color-1: var(--theia-color-text);
  --scalar-header-color-2: var(--theia-color-text-muted);
  --scalar-sidebar-background-1: var(--theia-color-bg);
  --scalar-sidebar-border-color: var(--theia-color-border-subtle);
  --scalar-sidebar-color-1: var(--theia-color-text);
  --scalar-sidebar-color-2: var(--theia-color-text-muted);
  --scalar-sidebar-color-active: var(--theia-color-brand);
  --scalar-sidebar-item-active-background: var(--theia-color-sidebar-active-bg);
  --scalar-sidebar-item-hover-background: var(--theia-color-sidebar-hover-bg);
  --scalar-sidebar-item-hover-color: var(--theia-color-brand);
  --scalar-sidebar-indent-border: var(--theia-color-border-subtle);
  --scalar-sidebar-indent-border-active: var(--theia-color-brand);
  --scalar-sidebar-indent-border-hover: var(--theia-color-brand-soft-border);
  --scalar-sidebar-search-background: var(--theia-color-surface-muted);
  --scalar-sidebar-search-border-color: var(--theia-color-border);
  --scalar-sidebar-search-color: var(--theia-color-text);
  --scalar-sidebar-search--color: var(--theia-color-text-muted);
  --scalar-text-decoration-color: var(--theia-color-brand-soft-border);
  --scalar-text-decoration-color-hover: var(--theia-color-brand);
  --scalar-tooltip-background: var(--theia-color-text);
  --scalar-tooltip-color: var(--theia-color-bg);
  --scalar-shadow-1: var(--theia-docs-shadow-raised);
  --scalar-shadow-2: var(--theia-docs-shadow-raised);
}

.spendware-scalar-reference * {
  scrollbar-color: var(--theia-color-scrollbar-thumb) var(--theia-color-scrollbar-track);
}

.spendware-scalar-reference :is(a, button):focus-visible {
  outline: 2px solid var(--theia-color-focus-ring);
  outline-offset: 2px;
}

.spendware-scalar-reference :is(a, button):hover {
  color: var(--theia-color-brand);
}

.spendware-scalar-reference [class*="bg-sidebar-b-search"] {
  color: var(--theia-color-text-muted);
  border-color: var(--theia-color-border);
  background: var(--theia-color-surface-muted);
}

.spendware-scalar-reference [class*="bg-sidebar-b-search"]:is(:hover, :focus-within) {
  color: var(--theia-color-text);
  border-color: var(--theia-color-brand-soft-border);
  background: var(--theia-color-interactive-bg-hover);
}

.spendware-api-reference-error {
  margin: 0;
  padding: 1rem;
  color: var(--theia-color-text);
}

@media screen and (max-width: 44.984rem) {
  .spendware-api-reference-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .spendware-api-reference-link {
    width: 100%;
    text-align: center;
  }
}