:root {
  --primary-color: #2563eb;
  --primary-dark-color: #1d4ed8;
  --primary-light-color: #60a5fa;
  --page-background-color: #ffffff;
  --page-foreground-color: #172033;
  --page-secondary-foreground-color: #667085;
  --separator-color: #e4e9f1;
  --side-nav-background: #f7f9fc;
  --header-background: rgba(255, 255, 255, .9);
  --code-background: #f4f7fb;
  --fragment-background: #f5f7fb;
  --fragment-foreground: #24324a;
  --border-radius-small: 7px;
  --border-radius-medium: 12px;
  --border-radius-large: 18px;
  --content-maxwidth: 1160px;
  --top-height: 70px;
  --font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-monospace: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html { scroll-behavior: smooth; }
body { letter-spacing: -.006em; }

#titlearea {
  position: relative;
  border: 0;
  box-shadow: 0 1px 0 var(--separator-color);
  backdrop-filter: blur(18px);
  background:
    radial-gradient(ellipse 280px 180px at 104% -70%, rgba(50, 130, 255, .72), rgba(50, 130, 255, 0) 72%),
    #10244d;
}

.project-home-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

.project-home-link:focus-visible {
  outline: 3px solid #8fb5ff;
  outline-offset: -4px;
}

#projectlogo img {
  width: 138px;
  height: auto;
  filter: brightness(0) invert(1);
}

#projectname {
  display: none;
}

#projectname::first-letter { color: var(--page-foreground-color); }

#projectbrief {
  color: #aebbd1;
  font-size: .82rem;
  font-weight: 650;
}

/* Search belongs to the working area, not to the navigation rail. */
@media screen and (min-width: 768px) {
  #main-nav {
    position: fixed;
    z-index: 120;
    top: 18px;
    left: calc(var(--side-nav-fixed-width) + 24px);
    right: 24px;
    width: auto;
    float: none;
  }

  #main-menu,
  #main-menu > li,
  #searchBoxPos2,
  #MSearchBox {
    width: 100% !important;
    max-width: none !important;
  }

  #MSearchField {
    width: calc(100% - 66px) !important;
  }

  #MSearchResultsWindow {
    left: calc(var(--side-nav-fixed-width) + 24px) !important;
    right: 24px !important;
    width: auto !important;
  }

  /* The generated member alphabet duplicates the useful member pages. */
  #nav-tree li:has(> .item a[href="functions.html"]) {
    display: none !important;
  }
}

/* The left tree is the single navigation source. The generated page outline
   repeats the same member list and steals useful reading width. */
#page-nav { display: none !important; }
#container { grid-template-columns: minmax(0, 1fr) !important; }

#side-nav {
  border-right: 1px solid var(--separator-color);
}

#nav-tree .selected {
  border-radius: 9px;
  background: #e8f0ff;
  color: #174eb8;
}

#nav-tree a { font-weight: 540; }

.contents { padding-top: 34px; }

.header {
  background: linear-gradient(120deg, #f4f7ff 0%, #f7fbff 48%, #eefbf7 100%);
  border-bottom: 1px solid var(--separator-color);
  padding: 30px max(24px, calc((100% - var(--content-maxwidth)) / 2));
}

.headertitle .title {
  color: #13203a;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.08;
}

div.contents > div.textblock:first-child {
  font-size: 1.02rem;
}

h1, h2, h3, h4, h5, h6 {
  color: #172033;
  letter-spacing: -.028em;
}

h2.groupheader {
  margin-top: 2.3em;
  padding-bottom: .55em;
  border-bottom: 1px solid var(--separator-color);
  color: #172033;
  font-size: 1.3rem;
}

.memberdecls,
.memberdef,
.directory,
.classindex,
.fieldtable {
  overflow: hidden;
  border: 1px solid var(--separator-color) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 35px rgba(28, 45, 80, .055);
}

.memitem { margin-bottom: 22px; }
.memtitle,
.memtitle::after,
.memproto,
.memberdecls td.memItemLeft,
.memberdecls td.memItemRight {
  background: #f5f7fb !important;
  color: #24324a !important;
}
.memtitle { border-color: var(--separator-color) !important; }
.memproto {
  border-radius: 14px 14px 0 0 !important;
  background: #f1f5fb !important;
  color: #24324a !important;
}
.memproto table,
.memproto .memname,
.memproto .paramtype,
.memproto .paramname { color: #24324a !important; }
.memdoc { border-radius: 0 0 14px 14px !important; }

code, .memname, .paramname {
  font-family: var(--font-family-monospace);
}

div.fragment {
  border: 1px solid var(--separator-color);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(28, 45, 80, .06);
}

.fragment .line { line-height: 1.62; }

#MSearchBox {
  border: 1px solid var(--separator-color);
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(25, 43, 75, .06);
}

.footer {
  color: var(--page-secondary-foreground-color);
  opacity: .8;
}

.mspos-download-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #cbdaf4;
  border-radius: 16px;
  background: linear-gradient(120deg, #f1f6ff, #f8fbff 58%, #effbf7);
}

.mspos-download-panel div,
.mspos-download-panel strong,
.mspos-download-panel span {
  display: block;
}

.mspos-download-panel span {
  margin-top: 3px;
  color: var(--page-secondary-foreground-color);
  font-size: .9rem;
}

.mspos-download-panel a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff !important;
  background: #2367e8;
  font-weight: 750;
}

@media (max-width: 767px) {
  :root { --top-height: 62px; }
  .header { padding: 24px 18px; }
  .contents { padding-inline: 17px; }
  .headertitle .title { font-size: 1.8rem; }
  .mspos-download-panel { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
