/* Keep the Read the Docs theme intact. Only Weeble-specific elements live here. */

.wy-side-nav-search > a img.logo,
.wy-side-nav-search .wy-dropdown > a img.logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
  object-fit: contain;
}

/* TypeScript signatures need more room than the theme's prose default. */
.wy-nav-content {
  max-width: 1120px;
}

/* SDK symbol lists need comfortable rows and an unmistakable current item. */
body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l4
  > a,
body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l5
  > a {
  min-height: 30px;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-size: 0.8125rem;
  line-height: 18px;
}

body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l4
  > a.current,
body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l5
  > a.current {
  position: relative;
  background: #e8f0f5 !important;
  box-shadow: inset 3px 0 #2980b9;
  color: #174f73 !important;
  font-weight: 600;
}

body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l4
  > a:not(.current):hover,
body:has(.weeble-api-reference)
  .wy-menu-vertical
  li.toctree-l5
  > a:not(.current):hover {
  background: #e6eaed !important;
  color: #1f2937 !important;
}

/* The SDK reference reads like a compact API index, not prose documentation. */
.rst-content:has(.weeble-api-reference) h1:first-child {
  margin-bottom: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid #d8dde3;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 2rem;
  letter-spacing: -0.025em;
}

.rst-content .weeble-api-reference {
  margin-top: 22px;
}

.rst-content .weeble-api-reference > dl.js {
  margin: 0;
}

.rst-content .weeble-api-reference > dl.js > dt.sig {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-top: 0 !important;
  border-left: 3px solid #2980b9;
  background: #f4f7f9;
  color: #253746;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rst-content .weeble-api-reference > dl.js > dd {
  margin: 0;
}

.rst-content .weeble-api-reference > dl.js > dd > p {
  max-width: 760px;
  margin: 12px 0;
}

.rst-content
  .weeble-api-reference
  > dl.js
  > dd
  > p:has(> em:first-child + code:last-child) {
  display: none;
}

.rst-content .weeble-api-reference dl.js dl.js {
  margin: 0;
  padding: 12px 0 13px;
  border-top: 1px solid #e0e4e8;
}

.rst-content .weeble-api-reference dl.js dl.js:first-of-type {
  margin-top: 20px;
}

.rst-content .weeble-api-reference dl.js dl.js > dt.sig {
  width: auto;
  max-width: 100%;
  margin: 0 0 5px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent;
  color: #253746;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-name {
  color: #2176a8;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-param,
.rst-content .weeble-api-reference dl.js dl.js > dt.sig .sphinx_js-type {
  color: #334155;
  font-style: normal;
  font-weight: 400;
}

.rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-return {
  color: #64748b;
  font-size: 0.92em;
}

.rst-content .weeble-api-reference dt.sig code.xref {
  padding: 0;
  border: 0;
  background: transparent !important;
  font-size: inherit;
}

.rst-content .weeble-api-reference dl.js dl.js > dd {
  max-width: 820px;
  margin: 0;
}

.rst-content .weeble-api-reference dl.js dl.js > dd > p {
  margin: 5px 0 0;
}

.rst-content .weeble-api-reference p.js.attribute.type {
  margin: 2px 0 5px;
  color: #536471;
  font-size: 0.88rem;
}

.rst-content .weeble-api-reference .weeble-member-heading {
  margin: 28px 0 7px;
  padding: 0;
  border: 0;
  color: #253746;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.rst-content .weeble-api-reference .weeble-type-parameters {
  margin-top: 22px;
}

.rst-content
  .weeble-api-reference
  .weeble-type-parameters
  .weeble-member-heading {
  margin-top: 0;
}

.rst-content .weeble-api-reference .weeble-type-parameters ul {
  margin: 7px 0 0 18px;
}

.rst-content .weeble-api-reference .sig-return {
  white-space: normal;
}

.rst-content .weeble-api-reference .sig-return-icon {
  font-size: 0;
}

.rst-content .weeble-api-reference .sig-return-icon::after {
  content: ":";
  font-size: 0.92rem;
}

.rst-content
  .weeble-api-reference
  dt.sig.weeble-complex-signature
  .sig-paren
  + dl {
  max-width: 800px;
  margin: 6px 0 7px 22px;
}

.rst-content
  .weeble-api-reference
  dt.sig.weeble-complex-signature
  .sig-paren
  + dl
  > dd {
  margin: 0;
  padding: 0;
}

.rst-content
  .weeble-api-reference
  dt.sig.weeble-complex-signature
  .sig-param {
  color: #334155;
  font-style: normal;
  line-height: 1.65;
}

.rst-content
  .weeble-api-reference
  dt.sig.weeble-complex-signature
  .sig-param
  > .n {
  color: #1f2937;
  font-weight: 600;
}

.rst-content
  .weeble-api-reference
  dt.sig.weeble-complex-signature
  .sig-param
  > .sphinx_js-type {
  display: block;
  margin: 3px 0 0 12px;
  padding-left: 12px;
  border-left: 1px solid #d8dde3;
  color: #334155;
  font-style: normal;
}

/* Match the compact field layout used by established API references. */
html.writer-html5 .rst-content .weeble-api-reference dl.js dl.field-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 14px;
  margin: 9px 0 0;
}

html.writer-html5
  .rst-content
  .weeble-api-reference
  dl.js
  dl.field-list
  > dt {
  grid-column: 1;
  margin: 0;
  padding-left: 0;
  font-weight: 700;
  text-align: right;
}

html.writer-html5
  .rst-content
  .weeble-api-reference
  dl.js
  dl.field-list
  > dd {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  padding: 0;
}

html.writer-html5
  .rst-content
  .weeble-api-reference
  dl.js
  dl.field-list
  > dd
  > ul,
html.writer-html5
  .rst-content
  .weeble-api-reference
  dl.js
  dl.field-list
  > dd
  > ul
  > li {
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  padding-left: 0;
}

html.writer-html5
  .rst-content
  .weeble-api-reference
  dl.js
  dl.field-list
  > dd
  > ul
  > li {
  list-style: none;
}

.rst-content .sig-param,
.rst-content .sphinx_js-type {
  white-space: normal;
}

/* A class page already establishes the owner; repeat only the member name. */
.rst-content dl.js.class dd dl.js > dt.sig .sig-prename,
.rst-content dl.js.interface dd dl.js > dt.sig .sig-prename {
  display: none;
}

/* Structured aliases get a property table instead of a giant inline object. */
.rst-content .weeble-object-alias > dl.js.typealias > dd > p.js.attribute.type,
.rst-content .weeble-object-value > dl.js.attribute > dd > p.js.attribute.type {
  display: none;
}

.rst-content .weeble-object-alias table.docutils,
.rst-content .weeble-object-value table.docutils {
  width: 100%;
  table-layout: auto;
}

.rst-content .weeble-object-alias table.docutils td:nth-child(2),
.rst-content .weeble-object-value table.docutils td:nth-child(2) {
  overflow-wrap: anywhere;
}

.rst-content .sphinx_js-type a.reference.internal code {
  color: #217db2;
}

.rst-content .sphinx_js-type a.reference.internal:hover code {
  text-decoration: underline;
}

/* Type syntax stays neutral. Links retain the theme's normal link color. */
.rst-content .weeble-ts-token {
  color: inherit;
  font-weight: inherit;
}

.rst-content a.weeble-ts-doc-link {
  text-decoration: none;
}

.rst-content a.weeble-ts-doc-link:hover {
  text-decoration: underline;
}

.rst-content a.weeble-ts-doc-link::after {
  display: none;
  content: none;
}

/* The live package catalog stays a reference list, not an application grid. */
.weeble-package-browser {
  margin-top: 24px;
}

.weeble-package-controls {
  display: flex;
  align-items: end;
  gap: 16px;
  max-width: 760px;
}

.weeble-package-search {
  display: block;
  flex: 1 1 auto;
  max-width: 560px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #252525;
}

.weeble-package-editor {
  display: block;
  flex: 0 0 180px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #252525;
}

.weeble-package-editor span {
  display: block;
  margin-bottom: 6px;
}

.weeble-package-editor select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #b7b9bc;
  border-radius: 2px;
  background: #ffffff;
  color: #252525;
  font: inherit;
}

.weeble-package-search span {
  display: block;
  margin-bottom: 6px;
}

.weeble-package-search input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #b7b9bc;
  border-radius: 2px;
  background: #ffffff;
  color: #252525;
  font: inherit;
}

.weeble-package-search input:focus-visible {
  border-color: #2980b9;
  outline: 2px solid rgb(41 128 185 / 24%);
  outline-offset: 1px;
}

.weeble-package-status {
  margin: 8px 0 22px;
  color: #666666;
  font-size: 0.9rem;
}

.weeble-package-entry {
  padding: 22px 0 26px;
  border-top: 1px solid #d9d9d9;
}

.weeble-package-entry:last-child {
  border-bottom: 1px solid #d9d9d9;
}

.rst-content .weeble-package-name {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.weeble-package-description {
  margin: 0 0 14px;
}

.rst-content table.weeble-package-versions {
  width: 100%;
  margin-bottom: 0;
}

.weeble-package-version {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.rst-content .weeble-package-version-link {
  color: #2472a4;
  font-weight: 600;
}

.rst-content .weeble-package-version-link:hover,
.rst-content .weeble-package-version-link:focus-visible {
  color: #174f73;
  text-decoration: underline;
}

@media screen and (max-width: 600px) {
  .weeble-package-controls {
    display: block;
  }

  .weeble-package-editor {
    max-width: 220px;
  }
}

.weeble-package-empty {
  padding: 18px 0;
  border-top: 1px solid #d9d9d9;
}

html[data-weeble-theme="dark"] {
  color-scheme: dark;
}

html[data-weeble-theme="dark"] {
  & body,
  & .wy-body-for-nav,
  & .wy-nav-content-wrap,
  & .wy-nav-content {
    background: #1e1f22;
    color: #d7d9dc;
  }

  & .wy-nav-side {
    background: #17181a;
  }

  & .wy-side-nav-search {
    background: #1d668f;
  }

  & .wy-side-nav-search input[type="text"] {
    border-color: #3c4249;
    background: #24262a;
    color: #f1f3f5;
  }

  & .wy-menu-vertical a {
    color: #c8cbd0;
  }

  & .wy-menu-vertical a:hover,
  & .wy-menu-vertical li.current > a:hover {
    background: #292b2f;
    color: #ffffff;
  }

  & .wy-menu-vertical li.current ul a {
    border-color: #34373c;
    background: #202226 !important;
    color: #c8cbd0 !important;
  }

  & .wy-menu-vertical li.current > a,
  & .wy-menu-vertical li.toctree-l2.current > a,
  & .wy-menu-vertical li.toctree-l3.current > a {
    border-color: #34373c;
    background: #24262a !important;
    color: #ffffff !important;
  }

  &
    body:has(.weeble-api-reference)
    .wy-menu-vertical
    li.toctree-l4
    > a.current,
  &
    body:has(.weeble-api-reference)
    .wy-menu-vertical
    li.toctree-l5
    > a.current {
    background: #292d32 !important;
    box-shadow: inset 3px 0 #58a9d6;
    color: #eef1f4 !important;
  }

  &
    body:has(.weeble-api-reference)
    .wy-menu-vertical
    li.toctree-l4
    > a:not(.current):hover,
  &
    body:has(.weeble-api-reference)
    .wy-menu-vertical
    li.toctree-l5
    > a:not(.current):hover {
    background: #292b2f !important;
    color: #ffffff !important;
  }

  & .rst-content h1,
  & .rst-content h2,
  & .rst-content h3,
  & .rst-content h4,
  & .rst-content h5,
  & .rst-content h6 {
    color: #f1f3f5;
  }

  & .rst-content a,
  & .wy-breadcrumbs a {
    color: #6ebce8;
  }

  & .wy-breadcrumbs,
  & .wy-breadcrumbs li,
  & footer,
  & footer p {
    color: #aeb2b8;
  }

  & .rst-content code,
  & .rst-content tt,
  & .rst-content .literal,
  & .rst-content pre,
  & .highlight,
  & .highlight pre {
    border-color: #3d4147;
    background: #292b2f;
    color: #e8eaed !important;
  }

  & .rst-content .weeble-api-reference > dl.js > dt.sig {
    border-left-color: #58a9d6;
    background: #252a2e !important;
    color: #f1f3f5;
  }

  & .rst-content .weeble-api-reference > dl.js > dt.sig .sig-name,
  & .rst-content .weeble-api-reference > dl.js > dt.sig .sig-prename,
  & .rst-content .weeble-api-reference > dl.js > dt.sig .sig-param,
  & .rst-content .weeble-api-reference > dl.js > dt.sig .sig-paren,
  & .rst-content .weeble-api-reference > dl.js > dt.sig .sphinx_js-type {
    color: #f1f3f5 !important;
  }

  & .rst-content .weeble-api-reference > dl.js > dt.sig .property {
    color: #6ebce8 !important;
  }

  & .rst-content .weeble-api-reference dl.js dl.js {
    border-top-color: #3a3d42;
  }

  & .rst-content .weeble-api-reference dl.js dl.js > dt.sig {
    background: transparent !important;
    color: #d7dce2;
  }

  & .rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-name {
    color: #7bc4f2 !important;
  }

  & .rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-param,
  & .rst-content .weeble-api-reference dl.js dl.js > dt.sig .sphinx_js-type {
    color: #d7dce2;
  }

  & .rst-content .weeble-api-reference dl.js dl.js > dt.sig .sig-return {
    color: #aeb7bf;
  }

  &
    .rst-content
    .weeble-api-reference
    dt.sig.weeble-complex-signature
    .sig-param
    > .n {
    color: #f1f3f5;
  }

  &
    .rst-content
    .weeble-api-reference
    dt.sig.weeble-complex-signature
    .sig-param
    > .sphinx_js-type {
    border-left-color: #464b52;
    color: #d7dce2;
  }

  & .rst-content .weeble-api-reference p.js.attribute.type {
    color: #aeb7bf;
  }

  & .rst-content .weeble-api-reference .weeble-member-heading {
    color: #f1f3f5;
  }

  & .rst-content .weeble-api-reference dl.js > dd,
  & .rst-content dl.simple > dd {
    color: #d7d9dc;
  }

  & .rst-content:has(.weeble-api-reference) h1:first-child {
    border-bottom-color: #3a3d42;
  }

  & .rst-content table.docutils,
  & .rst-content table.docutils:not(.field-list) th,
  & .rst-content table.docutils:not(.field-list) td {
    border-color: #41454b !important;
    background: #222428 !important;
    color: #dfe1e5 !important;
  }

  & .rst-content table.docutils:not(.field-list) tbody tr:nth-child(even) td {
    background: #27292d !important;
  }

  & .rst-content blockquote,
  & .rst-content .line-block,
  & .rst-content .topic {
    color: #d7d9dc;
  }

  & .rst-content .admonition,
  & .rst-content .admonition.note,
  & .rst-content .admonition.attention,
  & .rst-content .admonition.important {
    background: #25272b;
    color: #dfe1e5;
  }

  & .rst-content .admonition-title {
    color: #ffffff;
  }

  & hr {
    border-color: #3a3d42;
  }

  & .weeble-package-search input,
  & .weeble-package-editor select {
    border-color: #464a50;
    background: #24262a;
    color: #f1f3f5;
  }

  & .weeble-package-search,
  & .weeble-package-editor {
    color: #dfe1e5;
  }

  & .weeble-package-status {
    color: #aeb2b8;
  }

  & .weeble-package-entry,
  & .weeble-package-entry:last-child,
  & .weeble-package-empty {
    border-color: #3a3d42;
  }

  & .rst-content .weeble-package-version-link {
    color: #7bc4f2;
  }

  & .rst-content .weeble-package-version-link:hover,
  & .rst-content .weeble-package-version-link:focus-visible {
    color: #b3def8;
  }
}

html[data-weeble-theme="dark"]
  .rst-content
  .sphinx_js-type
  a.reference.internal
  code {
  color: #6ebce8 !important;
}

html[data-weeble-theme="dark"] .rst-content dl.js .property .k {
  color: inherit !important;
}

@media (max-width: 600px) {
  html.writer-html5
    .rst-content
    .weeble-api-reference
    dl.js
    dl.field-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  html.writer-html5
    .rst-content
    .weeble-api-reference
    dl.js
    dl.field-list
    > dt,
  html.writer-html5
    .rst-content
    .weeble-api-reference
    dl.js
    dl.field-list
    > dd {
    grid-column: 1;
    text-align: left;
  }
}
