/******************************************************************************/

#responsive-sidebar.sidebar-collapsed-desktop {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  border-right-width: 0;
}

#responsive-sidebar.sidebar-open-desktop {
  width: 20rem;
  opacity: 1;
  pointer-events: auto;
}

#responsive-sidebar.sidebar-collapsed-mobile {
  translate: -100% 0;
  transform: translateX(-100%);
}

#responsive-sidebar.sidebar-open-mobile {
  translate: 0 0;
  transform: translateX(0);
  width: 15rem;
}

/******************************************************************************/

/* Overall docs/help page layout wrapper around the main docs content, the
   package/sidebar navigation, and the on-page outline. */
.main-wrapper {
  display: flex;
  margin: 0 auto;
  max-width: 1800px;
}

/* Hide the right-side on-page outline by default; wider breakpoints opt it in. */
.main-wrapper .outline {
  display: none;
}

@media (min-width: 769px) {
  /* Tablet/desktop layout: main documentation content with a sidebar column. */
  .main-wrapper {
    display: grid;
    grid-gap: 1rem;
    gap: 1rem;
    grid-template-areas: "main sidebar";
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    padding-left: 1.5rem;
    padding-right: 3rem;
  }

  /* Shared vertical breathing room for docs content, sidebar, and outline. */
  .main-wrapper .main-content,
  .main-wrapper .sidebar,
  .main-wrapper .outline {
    padding-bottom: 1rem;
    padding-top: 1rem;
  }

  /* Places the package/docs navigation sidebar in the sidebar grid area. */
  .main-wrapper .sidebar {
    align-self: start;
    grid-area: sidebar;
    padding-top: 1rem;
  }

  /* Places the generated documentation article/content in the main grid area. */
  .main-wrapper .main-content {
    grid-area: main;
  }
}

@media (min-width: 1200px) {
  /* Wide layout: docs sidebar on the left, page content center, outline right. */
  .main-wrapper {
    display: grid;
    grid-gap: 2rem;
    gap: 2rem;
    grid-template-areas: "sidebar main outline";
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Shows the right-side in-page outline on wide screens. */
  .main-wrapper .outline {
    display: block;
    grid-area: outline;
    height: -webkit-fit-content;
    height: fit-content;
    padding-bottom: 0;
  }

  /* Hides the smaller in-navigation outline when the dedicated outline exists. */
  .main-wrapper .in-nav-outline {
    display: none;
  }
}

/******************************************************************************/

/* Right-side in-page outline container, listing anchors from the current docs page. */
.outline-container {
  padding-bottom: 1rem;
  font-size: 0.75rem;
}

/* Removes browser list styling from outline anchor lists. */
.outline-container ul {
  list-style-type: none;
  margin: 0;
}

/* Wrapper around docs sidebar content; becomes sticky/flexible at larger sizes. */
.sidebar-container {
  font-size: 0.75rem;
  position: -webkit-sticky;
  position: sticky;
}

/* Removes browser numbering/spacing from package navigation lists. */
.sidebar-container ol {
  list-style-type: none;
  padding-left: 10px;
  margin: 0;
}

/* Keeps long package/doc link labels on one line and truncates them neatly. */
.sidebar-container li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 769px) and (min-height: 44rem) {
  /* Taller desktop viewports let the sidebar stack its nav and outline regions. */
  .sidebar-container {
    display: flex;
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  /* Restores normal stacking on desktop after mobile/sidebar overlay behavior. */
  .sidebar-container {
    z-index: auto;
  }
}

@media (min-width: 769px) and (not (min-height: 44rem)) {
  /* Short desktop viewports scroll the sidebar instead of forcing content offscreen. */
  .sidebar-container {
    overflow: auto;
  }
}

/* Positions the outline placeholder inside the sidebar/outline grid region. */
.sidebar-container .outline-container .place,
.sidebar-container.outline-container .place {
  grid-area: outline;
  margin: 0;
}

@media (min-width: 1200px) {
  /* Lets the sidebar container stop creating a box so child regions join the grid. */
  .sidebar-container {
    display: contents;
  }

  /* Removes any sidebar fade mask once the wide layout has enough room. */
  .sidebar-container .sidebar {
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* Makes the wide-screen outline/sidebar region sticky and independently scrollable. */
  .sidebar-container .outline-container,
  .sidebar-container.outline-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: auto;
    position: -webkit-sticky;
    position: sticky;
  }

  /* Adds spacing below the outline heading/placeholder in the wide layout. */
  .sidebar-container .outline-container .place,
  .sidebar-container.outline-container .place {
    margin: 1rem 0;
    padding-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  /* Hides the outline placeholder in the mobile sidebar. */
  .sidebar-container .outline-container .place,
  .sidebar-container.outline-container .place {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Mobile docs sidebar overlay: hidden by default and fixed to the viewport. */
  .sidebar {
    display: none;
    height: 100vh;
    left: 0;
    max-height: 100vh;
    position: fixed;
    right: 0;
  }

  /* Sliding inner panel for the mobile docs sidebar navigation. */
  .sidebar .sidebar-inner {
    display: grid;
    max-width: 20rem;
    overflow: hidden;
    overflow: auto;
    padding: 1rem;
    position: relative;
    transform: translateX(-100%);
    transition: transform 0.2s linear;
    width: 80vw;
    will-change: transform;
  }

  /* Lets the mobile sidebar's inner nav children participate directly in layout. */
  .sidebar .sidebar-inner .sidebar-inner-nav {
    display: contents;
    padding-bottom: 3rem;
  }
}

/******************************************************************************/

/* Allows generated documentation text/content to wrap instead of overflowing. */
.main-page-content {
  overflow-wrap: break-word;
}

.main-page-content .m2-doc-hero {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 2rem;
}

.main-page-content .m2-doc-eyebrow {
  margin-bottom: 0.5rem;
  color: var(--app-text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-page-content .m2-doc-title {
  color: var(--app-text);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .main-page-content .m2-doc-title {
    font-size: 4.5rem;
  }
}

.main-page-content .m2-doc-subtitle {
  max-width: 72ch;
  margin-top: 1.25rem;
  color: var(--app-text-muted);
  font-size: 1.25rem;
  line-height: 1.7;
}

.main-page-content .m2-doc-section {
  margin-bottom: 3rem;
  max-width: 100%;
}

.main-page-content .m2-doc-section > * + * {
  margin-top: 1.25rem;
}

.main-page-content .m2-doc-section h2 {
  margin-top: 2rem;
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 0.5rem;
  color: var(--app-text);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.main-page-content .m2-doc-section h2:first-child {
  margin-top: 0;
}

.main-page-content .m2-doc-section h3 {
  margin-top: 1.75rem;
  color: var(--app-text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.main-page-content .m2-doc-section h4,
.main-page-content .m2-doc-section h5,
.main-page-content .m2-doc-section h6 {
  margin-top: 1.5rem;
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

.main-page-content .m2-doc-section p,
.main-page-content .m2-doc-section li,
.main-page-content .m2-doc-section dd {
  color: var(--app-text-muted);
  font-size: 1.125rem;
  line-height: 1.8;
}

.main-page-content .m2-doc-title::first-letter,
.main-page-content .m2-doc-subtitle::first-letter,
.main-page-content .m2-doc-section h2::first-letter,
.main-page-content .m2-doc-section h3::first-letter,
.main-page-content .m2-doc-section h4::first-letter,
.main-page-content .m2-doc-section h5::first-letter,
.main-page-content .m2-doc-section h6::first-letter,
.main-page-content .m2-doc-section p::first-letter,
.main-page-content .m2-doc-section li::first-letter,
.main-page-content .m2-doc-section dt::first-letter,
.main-page-content .m2-doc-section dd::first-letter {
  text-transform: uppercase;
}

.main-page-content .m2-doc-section a {
  color: var(--app-link);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.main-page-content .m2-doc-section a:hover {
  text-decoration-line: underline;
}

.main-page-content .m2-doc-section ul,
.main-page-content .m2-doc-section ol {
  margin-top: 1.25rem;
  padding-left: 1.75rem;
}

.main-page-content .m2-doc-section ul {
  list-style: disc;
}

.main-page-content .m2-doc-section ol {
  list-style: decimal;
}

.main-page-content .m2-doc-section li + li {
  margin-top: 0.75rem;
}

.main-page-content .m2-doc-section dl.element,
.main-page-content .m2-doc-section .waystouse,
.main-page-content .m2-doc-section .exports {
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: var(--card);
  padding: 1.25rem;
}

.main-page-content .m2-doc-section dt {
  color: var(--app-text);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-page-content .m2-doc-synopsis {
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: var(--card);
  padding: 1.25rem;
}

.main-page-content .m2-doc-synopsis > ul {
  display: grid;
  gap: 1rem;
  padding-left: 0;
  list-style: none;
}

.main-page-content .m2-doc-synopsis > ul > li {
  border: 1px solid var(--app-border);
  border-radius: 0.375rem;
  background: var(--app-surface);
  padding: 1rem;
}

.main-page-content .m2-doc-section table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: var(--card);
}

.main-page-content .m2-doc-section table tbody {
  display: table;
  min-width: 100%;
}

.main-page-content .m2-doc-section tr + tr td {
  border-top: 1px solid var(--app-border);
}

.main-page-content .m2-doc-section td,
.main-page-content .m2-doc-section th {
  padding: 1rem;
  vertical-align: top;
}

.main-page-content .m2-doc-section pre {
  max-width: 100%;
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: var(--card) !important;
  padding: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.main-page-content .m2-doc-section pre code,
.main-page-content .m2-doc-section pre code * {
  white-space: pre !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.main-page-content .m2-doc-section blockquote {
  margin: 1.5rem 0;
  border-left: 4px solid var(--accent);
  border-radius: 0.375rem;
  background: var(--card);
  padding: 1rem 1.25rem;
}

.main-page-content .m2-doc-section img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: var(--card);
}

.main-page-content .m2-doc-section kbd,
.main-page-content .m2-doc-section .tt {
  border: 1px solid var(--app-border);
  border-radius: 0.375rem;
  background: var(--card);
  padding: 0.125rem 0.375rem;
  color: var(--app-text);
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  font-size: 0.95em;
}

.main-page-content .m2-doc-equation-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .main-page-content .m2-doc-equation-grid {
    grid-template-columns: repeat(3, minmax(18rem, 1fr));
  }
}

.main-page-content .m2-doc-equation-table {
  margin: 0;
}

.main-page-content .m2-doc-equation-source {
  border-right: 1px solid var(--app-border);
  padding-right: 0.75rem;
}

.main-page-content .m2-doc-equation-rendered {
  padding-left: 0.75rem;
}

.outline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.outline-item {
  font-size: 16px;
  text-transform: capitalize;
  border-radius: 0.375rem;
  line-height: 1.45;
  padding: 4px 8px;
  transition: all;
  transition-duration: 300ms;
  cursor: pointer;
  line-clamp: 1;
}

.outline-link::first-letter {
  text-transform: uppercase;
}

.outline-item:hover {
  background-color: var(--muted);
}

.index-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  min-width: max-content;
  padding: 0;
}

.index-item {
  line-height: 1.45;
  text-transform: capitalize;
}

.index-item a,
.index-item.toggle > details > summary {
  border-radius: 0.375rem;
  display: block;
  padding: 4px 10px;
  white-space: nowrap;
}

.index-item a::first-letter {
  text-transform: uppercase;
}

.index-item.toggle > details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.index-item.toggle > details > summary::-webkit-details-marker {
  display: none;
}

.index-item.toggle > details > summary::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 150ms ease;
}

.index-item.toggle > details:not([open]) > summary::before {
  transform: rotate(-90deg);
}

.index-item a:hover,
.index-item.toggle > details > summary:hover {
  background-color: var(--muted);
}

.index-item.toggle > details > ol {
  list-style: none;
  margin: 4px 0 0;
  padding-left: 18px;
}

/******************************************************************************/
