.docs-body {
  margin: 0;
  background-color: #080c14;
  color: #a8b8c8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100vh;
}

.docs-main {
  max-width: 75rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.docs-layout {
  max-width: none;
  margin: 0;
  padding: 0 1.25rem 0 0;
  display: grid;
  grid-template-areas: "side main";
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* Narrow screens: mobile chrome + drawer (see @media max-width 900px). Hidden on wide viewports. */
.docs-mobile-nav-bar,
.docs-nav-backdrop {
  display: none;
}

.docs-mobile-nav-bar {
  box-sizing: border-box;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  padding-top: calc(0.55rem + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid #1a2a40;
  background: #080c14;
  z-index: 45;
}

.docs-nav-menu-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: #dde8f0;
  background: #111c2e;
  border: 1px solid #1e2d47;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.docs-nav-menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.docs-nav-menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.docs-nav-menu-btn:hover {
  border-color: #3a5070;
  color: #00d4ff;
}

.docs-nav-menu-btn:focus-visible {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

.docs-mobile-nav-brand {
  min-width: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dde8f0;
  text-decoration: none;
  transition: color 0.15s;
}

.docs-mobile-nav-brand:hover {
  color: #00d4ff;
}

/* Main column + right “On this page” subnav (second column added when JS sets --with-toc) */
.docs-main-wrap {
  grid-area: main;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 1.75rem;
  align-items: start;
  min-width: 0;
}

.docs-main-wrap--with-toc {
  grid-template-columns: minmax(0, 1fr) minmax(11.5rem, 14rem);
}

.docs-toc {
  position: sticky;
  top: 1.25rem;
  align-self: start;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 0.75rem 0.85rem;
  border: 1px solid #1a2a40;
  background: #0a101c;
  scrollbar-width: thin;
  scrollbar-color: #3f5875 #0e1525;
}

.docs-toc::-webkit-scrollbar {
  width: 8px;
}

.docs-toc::-webkit-scrollbar-track {
  background: #0e1525;
  border-radius: 4px;
}

.docs-toc::-webkit-scrollbar-thumb {
  background: #334a6e;
  border-radius: 4px;
}

.docs-toc-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aacbf;
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1a2a40;
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-toc-link {
  display: block;
  color: #8a9db4;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
  padding: 0.28rem 0;
  border-left: 2px solid transparent;
  margin-left: -2px;
  padding-left: 0.35rem;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toc-link[data-level="3"] {
  padding-left: 0.95rem;
  font-size: 0.84rem;
}

.docs-toc-link[data-level="4"] {
  padding-left: 1.45rem;
  font-size: 0.8rem;
  color: #6f8196;
}

.docs-toc-link:hover {
  color: #d8e3ed;
  text-decoration: none;
}

.docs-toc-link--active {
  color: #00d4ff;
  border-left-color: #00d4ff;
}

@media (max-width: 72rem) {
  .docs-main-wrap--with-toc {
    grid-template-columns: 1fr;
  }

  .docs-main-wrap--with-toc .docs-toc {
    position: static;
    max-height: none;
    order: 2;
  }

  .docs-main-wrap--with-toc .docs-main {
    order: 1;
  }
}

.docs-sidebar {
  grid-area: side;
  position: sticky;
  top: 0;
  height: 100vh;
}

.docs-sidebar-inner {
  border: 1px solid #1a2a40;
  border-radius: 0;
  background: #0a101c;
  padding: 0.9rem 0.85rem;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.docs-sidebar-brand {
  display: block;
  margin: 0 0 1rem;
  padding: 0 0.5rem 0.75rem;
  padding-bottom: 0;
  border-bottom: 1px solid #1a2a40;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dde8f0;
  text-decoration: none;
  transition: color 0.15s;
  flex: 0 0 auto;
}

.docs-sidebar-brand:hover {
  color: #00d4ff;
}

.docs-sidebar-title {
  margin-bottom: 0.65rem;
  margin-top: 1rem;
  padding: 0 0.5rem 0.65rem;
  padding-bottom: 0;
  border-bottom: 1px solid #1a2a40;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aacbf;
}

.docs-sidebar-list > .docs-sidebar-title:first-child {
  margin-top: 0;
}

.docs-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* Thin dark scrollbars (sidebar, search, in-page preview) — same tokens as app bot picker */
.docs-sidebar-list,
.docs-search-results,
.docs-try-preview-mount {
  scrollbar-width: thin;
  scrollbar-color: #3f5875 #0e1525;
}

.docs-sidebar-list::-webkit-scrollbar,
.docs-search-results::-webkit-scrollbar,
.docs-try-preview-mount::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.docs-sidebar-list::-webkit-scrollbar-track,
.docs-search-results::-webkit-scrollbar-track,
.docs-try-preview-mount::-webkit-scrollbar-track {
  background: #0e1525;
  border-radius: 4px;
}

.docs-sidebar-list::-webkit-scrollbar-thumb,
.docs-search-results::-webkit-scrollbar-thumb,
.docs-try-preview-mount::-webkit-scrollbar-thumb {
  background: #334a6e;
  border-radius: 4px;
}

.docs-sidebar-list::-webkit-scrollbar-thumb:hover,
.docs-search-results::-webkit-scrollbar-thumb:hover,
.docs-try-preview-mount::-webkit-scrollbar-thumb:hover {
  background: #4a6490;
}

.docs-sidebar-list--nested {
  margin-left: 0.7rem;
  margin-top: 0.25rem;
  padding-left: 0.7rem;
  border-left: 1px solid #1a2a40;
}

.docs-sidebar-item + .docs-sidebar-item,
.docs-sidebar-section + .docs-sidebar-section {
  margin-top: 0.2rem;
}

.docs-sidebar-section-head {
  margin-top: 0.45rem;
}

.docs-sidebar-link,
.docs-sidebar-section-link {
  display: block;
  color: #a8b8c8;
  text-decoration: none;
  border-radius: 0;
  padding-left: .5rem;
  transition: background-color 0.15s, color 0.15s;
}

.docs-sidebar-link:hover,
a.docs-sidebar-section-link:hover {
  background: #111c2e;
  color: #d8e3ed;
  text-decoration: none;
}

span.docs-sidebar-section-link {
  cursor: default;
}

.docs-sidebar-link--active {
  color: #00d4ff;
  background: #0f1d31;
  box-shadow: inset 0 0 0 1px #1d3557;
}

.docs-sidebar-link--toggleable,
.docs-sidebar-section-link.docs-sidebar-link--toggleable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-right: 0.7rem;
}

.docs-sidebar-link--toggleable::after,
.docs-sidebar-section-link.docs-sidebar-link--toggleable::after {
  content: "▴";
  font-size: 0.7rem;
  line-height: 1;
  color: #6f8196;
  transform: translateY(0.02rem);
}

.docs-sidebar-link--toggleable[aria-expanded="false"]::after,
.docs-sidebar-section-link.docs-sidebar-link--toggleable[aria-expanded="false"]::after {
  content: "▾";
}

.docs-sidebar-link--heading {
  font-size: 0.92rem;
  color: #7f90a4;
  padding-left: 0.5rem;
}

.docs-sidebar-link--heading:hover {
  color: #d8e3ed;
}

.docs-sidebar-page-headings {
  margin-left: 1.55rem;
}

.docs-sidebar-page-headings .docs-sidebar-link[data-docs-heading-level="3"] {
  padding-left: 1.35rem;
  font-size: 0.9rem;
  color: #6f8196;
}

.docs-sidebar-page-headings .docs-sidebar-link[data-docs-heading-level="3"]:hover {
  color: #d0dbe6;
}

.docs-layout .docs-main {
  max-width: none;
  margin: 0;
  padding: 1.5rem;
  padding-left: 5rem;
  padding-right: 5rem;
  min-width: 0;
}

.docs-pager {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a2a40;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.docs-pager-link {
  display: inline;
  color: #5ec8ff;
  text-decoration: none;
  transition: color 0.15s;
}

.docs-pager-link:hover {
  color: #9edfff;
  text-decoration: underline;
}

.docs-pager-link--next {
  text-align: right;
}

.docs-pager-spacer {
  display: block;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: #dde8f0;
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
}

.markdown-body h1 {
  font-size: 2.15rem;
  margin-top: 0;
  letter-spacing: 0.08em;
}

.markdown-body h2 {
  font-size: 1.55rem;
  border-bottom: 1px solid #1a2a40;
  padding-bottom: 0.35rem;
}

.markdown-body h3 {
  font-size: 1.25rem;
}

@keyframes docs-heading-jump-flash {
  0% {
    background-color: rgba(0, 212, 255, 0.16);
    box-shadow: inset 3px 0 0 0 #00d4ff;
  }
  55% {
    background-color: rgba(0, 212, 255, 0.1);
    box-shadow: inset 3px 0 0 0 #00d4ff;
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.markdown-body h2.docs-heading-jump-flash,
.markdown-body h3.docs-heading-jump-flash,
.markdown-body h4.docs-heading-jump-flash {
  animation: docs-heading-jump-flash 0.85s ease-out forwards;
}

.markdown-body h2.docs-heading-jump-flash--reduced,
.markdown-body h3.docs-heading-jump-flash--reduced,
.markdown-body h4.docs-heading-jump-flash--reduced {
  background-color: rgba(0, 212, 255, 0.12);
  box-shadow: inset 3px 0 0 0 #00d4ff;
}

.markdown-body p {
  margin-bottom: 1em;
}

.markdown-body a {
  color: #5ec8ff;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1em 1.25em;
}

.markdown-body li {
  margin-bottom: 0.35em;
}

.markdown-body code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95em;
  background: #111c2e;
  border: 1px solid #1e2d47;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: #e8c0a0;
}

.markdown-body pre {
  margin: 1em 0;
  padding: 1rem 1.1rem;
  background: #070d1a;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  overflow-x: auto;
}

.docs-code-wrap {
  margin: 1em 0;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  overflow: hidden;
  background: #070d1a;
}

.docs-code-wrap pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

.docs-code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0.55rem;
  background: #0e1525;
  border-bottom: 1px solid #1a2a40;
}

.docs-code-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9aacbf;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.docs-copy-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aacbf;
  background: #111c2e;
  border: 1px solid #1e2d47;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.docs-code-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.docs-code-toolbar .docs-copy-btn,
.docs-code-toolbar .docs-try-btn {
  flex: 0 0 auto;
}

.docs-copy-btn:hover,
.docs-try-btn:hover {
  border-color: #3a5070;
  color: #c0d0e0;
}

.docs-copy-btn--done {
  border-color: #2a6048;
  color: #7dccb0;
}

.docs-try-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aacbf;
  background: #111c2e;
  border: 1px solid #1e2d47;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

/* Starter download etc.: beat .markdown-body a link color / underline */
.markdown-body a.docs-try-btn {
  color: #9aacbf;
  text-decoration: none;
  display: inline-block;
}

.markdown-body a.docs-try-btn:hover {
  border-color: #3a5070;
  color: #c0d0e0;
  text-decoration: none;
}

/* Match app “Download starter code” buttons (see .sb-btn--starter-download in styles.css). */
.docs-try-btn.docs-try-btn--starter-download {
  border: 2px solid #41ff8f;
  box-shadow: 0 0 0 1px rgba(65, 255, 143, 0.45);
}

.markdown-body a.docs-try-btn.docs-try-btn--starter-download:hover {
  border-color: #7dffc0;
  box-shadow: 0 0 0 1px rgba(125, 255, 192, 0.55);
  color: #c0d0e0;
  text-decoration: none;
}

.docs-try-btn.docs-try-btn--starter-download:focus-visible {
  outline: 2px solid #7dffc0;
  outline-offset: 2px;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.95rem;
}

/* Highlight.js fills in colors; keep a fallback for unlabeled fences */
.markdown-body pre code:not(.hljs) {
  color: #8899aa;
}

/* github-dark.min.css adds padding on code.hljs; outer .markdown-body pre already pads */
.markdown-body pre code.hljs {
  padding: 0 !important;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid #1a2a40;
  margin: 2rem 0;
}

.markdown-body blockquote {
  margin: 1em 0;
  padding-left: 1rem;
  border-left: 3px solid #2e4060;
  color: #7a8a9a;
}

/* ── Actions page: mini hex demos ─────────────────────────────────────── */

.action-demo {
  margin: 1rem 0 1.35rem;
  padding: 14px 16px;
  padding-top: 0;
  background: #0e1525;
  border: 1px solid #1a2a40;
  border-radius: 8px;
}

.action-demo-grid {
  height: min(220px, 48vw);
  min-height: 150px;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #070d1a;
}

.action-demo-grid svg {
  width: 100%;
  height: 100%;
}

.action-demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.action-demo-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c0d0e0;
  background: #111c2e;
  border: 1px solid #1e2d47;
  border-radius: 4px;
  padding: 0.45rem 1rem;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.action-demo-btn:hover:not(:disabled) {
  border-color: #3a5070;
  color: #eef4f8;
}

.action-demo-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-demo-btn--secondary {
  color: #8a9db4;
}

/* Primary run control in interactive doc widgets (Play / Start) */
.action-demo-btn[data-demo-play],
.action-demo-btn[data-try-run] {
  outline: 2px solid #38d97a;
  outline-offset: 2px;
}

.action-demo-btn[data-demo-play]:hover:not(:disabled),
.action-demo-btn[data-try-run]:hover:not(:disabled) {
  outline-color: #52e892;
}

.action-demo-caption {
  margin: 0;
  font-size: 0.92rem;
  color: #7a8a9a;
  line-height: 1.45;
}

.hex-hover-demo {
  margin: 1rem 0 1.35rem;
  padding: 14px 16px;
  background: #0e1525;
  border: 1px solid #1a2a40;
  border-radius: 8px;
}

.hex-hover-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hex-hover-map {
  border: 1px solid #1a2a40;
  background: #070d1a;
  min-height: 180px;
}

/* Distance ring widget: cap height (~½ intrinsic at doc width); center so we don’t shrink width+height together */
.hex-dist-demo .hex-hover-map {
  min-height: 0;
  max-height: min(560px, 82vh);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hex-dist-demo .hex-hover-map svg {
  display: block;
  max-height: min(560px, 82vh);
  max-width: 100%;
  width: auto;
  height: auto;
}

.hex-hover-title {
  margin: 0 0 0.35rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aacbf;
}

.hex-hover-readout {
  margin: 0.7rem 0 0;
  font-size: 0.96rem;
  color: #8ea2b8;
}

.hex-hover-readout--inline {
  margin-top: 0.45rem;
}

.hex-dist-toolbar {
  margin-bottom: 0.65rem;
}

.hex-dist-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aacbf;
}

.hex-dist-label select {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88rem;
  color: #dde8f0;
  background: #111c2e;
  border: 1px solid #1e2d47;
  border-radius: 0;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.hex-dist-ring-label {
  color: #9aacbf;
}

.hex-dist-hint {
  color: #7a8a9a;
  font-size: 0.88rem;
}

.hex-axis-q {
  color: #ff6b8a;
}

.hex-axis-r {
  color: #53d97a;
}

.hex-axis-s {
  color: #b58dff;
}

.hex-axis-value {
  color: #dfe7ef;
}

.markdown-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  overflow: hidden;
}

/* Horizontal scroll for wide tables (especially mobile). Built by `wrapMarkdownTables` in build-docs.mjs. */
.markdown-body .docs-table-scroll {
  box-sizing: border-box;
  max-width: 100%;
  margin: 1em 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #1a2a40;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: #3f5875 #0e1525;
}

.markdown-body .docs-table-scroll::-webkit-scrollbar {
  height: 8px;
}

.markdown-body .docs-table-scroll::-webkit-scrollbar-track {
  background: #0e1525;
  border-radius: 0 0 6px 6px;
}

.markdown-body .docs-table-scroll::-webkit-scrollbar-thumb {
  background: #334a6e;
  border-radius: 4px;
}

.markdown-body .docs-table-scroll table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.markdown-body table th, .markdown-body table td {
  padding: 0.5rem 1rem;
}

.markdown-body table th {
  background: #111c2e;
  text-align: left;
}

@media (max-width: 900px) {
  .markdown-body .docs-table-scroll table th,
  .markdown-body .docs-table-scroll table td {
    padding: 0.45rem 0.75rem;
  }
}

@media (min-width: 901px) {
  .markdown-body .docs-table-scroll {
    overflow-x: hidden;
  }

  .markdown-body .docs-table-scroll table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
  }

  .markdown-body .docs-table-scroll th,
  .markdown-body .docs-table-scroll td {
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: top;
  }

  .markdown-body .docs-table-scroll td code,
  .markdown-body .docs-table-scroll th code {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
}

.markdown-body abbr[title] {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
}

/* ── Sidebar search ───────────────────────────────────────────────────── */

.docs-search {
  position: relative;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1a2a40;
  flex: 0 0 auto;
}

.docs-search::before {
  content: "⌕";
  position: absolute;
  left: 0.55rem;
  top: 0.48rem;
  font-size: 0.95rem;
  line-height: 1;
  color: #6f8196;
  pointer-events: none;
}

.docs-search-input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.6rem 0.5rem 1.7rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.92rem;
  color: #dde8f0;
  background: #111c2e;
  border: 2px solid #3f5875;
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.docs-search-input::placeholder {
  color: #7e95ac;
}

.docs-search-input:focus {
  background: #111c2e;
  border-color: #6e8fb2;
}

.docs-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0.3rem 0;
  background: #0e1525;
  border: 1px solid #1e2d47;
  border-radius: 0;
  max-height: 22rem;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.docs-search-results[hidden] {
  display: none;
}

.docs-search-result {
  margin: 0;
  padding: 0;
}

.docs-search-result-link {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  color: #a8b8c8;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
  border-radius: 0;
  transition: background-color 0.1s, color 0.1s;
  cursor: pointer;
}

.docs-search-result-link:hover,
.docs-search-result--active .docs-search-result-link {
  background: #172240;
  color: #dde8f0;
  text-decoration: none;
}

.docs-search-page {
  flex-shrink: 0;
  font-weight: 600;
  color: inherit;
}

.docs-search-sep {
  flex-shrink: 0;
  color: #3a5070;
  font-size: 0.8rem;
}

.docs-search-section {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a8a9a;
}

.docs-search-empty {
  padding: 0.5rem 0.65rem;
  color: #5a6e82;
  font-size: 0.88rem;
}

.docs-search-highlight {
  background: #00e5ff;
  color: #03111c;
  border-radius: 0;
  padding: 0.04em 0.14em;
  box-shadow: 0 0 0 1px #7ff4ff;
}

/* In-page game preview (Try it out) */
.docs-try-preview-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  box-sizing: border-box;
}

.docs-try-preview-root[hidden] {
  display: none !important;
}

.docs-try-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.docs-try-preview-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(96vw, 720px);
  height: auto;
  max-height: calc(100vh - 1.5rem);
  background: #0a101c;
  border: 1px solid #1a2a40;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.docs-try-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #1a2a40;
  background: #080c14;
}

.docs-try-preview-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dde8f0;
}

.docs-try-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-try-preview-open-full {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: #00d4ff;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border: 1px solid #1a4a60;
  background: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.docs-try-preview-open-full:hover {
  color: #7ff4ff;
  border-color: #00a8cc;
  background: rgba(0, 212, 255, 0.08);
}

.docs-try-preview-close {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: 1px solid #2a4058;
  border-radius: 0;
  background: #0f1824;
  color: #9aacbf;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.docs-try-preview-close:hover {
  color: #dde8f0;
  border-color: #00a8cc;
  background: #152030;
}

.docs-try-preview-mount {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  background: #0e1525;
}

/* Loading screen (before preview module runs) */
.docs-try-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 200px;
  padding: 1.5rem 1rem;
  text-align: center;
}

.docs-try-preview-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #1a2a40;
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: docs-try-preview-spin 0.85s linear infinite;
}

@keyframes docs-try-preview-spin {
  to {
    transform: rotate(360deg);
  }
}

.docs-try-preview-loading-brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #dde8f0;
}

.docs-try-preview-loading-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: #8ea2b8;
}

.docs-try-preview-loading-hint {
  font-size: 0.82rem;
  color: #5a6e82;
}

.docs-try-mini-error {
  margin: 0;
  font-size: 0.95rem;
  color: #ff8a9a;
  padding: 0.5rem 0;
}

/* Mini runner: same visual language as .action-demo */
.docs-try-mini.action-demo {
  margin: 0;
  max-width: none;
  padding-bottom: 0;
}

.docs-try-mini-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 12px;
  margin-bottom: 10px;
  padding-top: 1.5rem;
}

.docs-try-mini-heading {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.docs-try-mini-buttons {
  margin: 0;
  margin-bottom: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.docs-try-mini-grid.action-demo-grid {
  height: min(48vh, 400px);
  min-height: 180px;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .docs-mobile-nav-bar {
    display: flex;
    position: sticky;
    top: 0;
  }

  .docs-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(4, 8, 14, 0.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .docs-nav-backdrop[hidden] {
    display: none !important;
  }

  .docs-layout {
    display: block;
    padding: 0 1rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .docs-main-wrap {
    grid-area: unset;
  }

  .docs-sidebar {
    grid-area: unset;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20rem, 88vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 50;
    margin: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.55);
  }

  .docs-body.docs-nav-drawer-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-sidebar-inner {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .docs-sidebar-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: none;
  }

  .docs-layout .docs-main {
    padding: 1rem;
  }

  .docs-pager {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-pager-link--next {
    text-align: left;
  }

  .docs-search-results {
    position: relative;
    top: auto;
    box-shadow: none;
    margin-top: 0.3rem;
  }

  .hex-hover-demo-grid {
    grid-template-columns: 1fr;
  }

  .docs-try-preview-root {
    padding: 0.35rem;
    align-items: stretch;
  }

  .docs-try-preview-panel {
    width: 100%;
    max-height: calc(100vh - 0.7rem);
  }

  .docs-try-preview-header {
    flex-wrap: wrap;
  }

  .docs-try-preview-title {
    font-size: 0.88rem;
  }

  .docs-try-mini-grid.action-demo-grid {
    height: min(40vh, 340px);
    min-height: 150px;
  }
}
