:root {
  --hdmr-text: #3b4351;
  --hdmr-heading: #253246;
  --hdmr-link: #5d708f;
  --hdmr-link-hover: #44556f;
  --hdmr-accent: #2f98a8;
  --hdmr-brand: #31557f;
  --hdmr-border: #d9dee6;
  --hdmr-surface: #f7f8fa;
  --hdmr-code-bg: #f4f6f8;
  --hdmr-icon: #7d8794;
  --hdmr-icon-hover: #55606f;
}

/* =========================
   Header
========================= */
.bd-header.navbar {
  min-height: 86px;
  background: #ffffff !important;
  border-bottom: 1px solid #eceff3;
  box-shadow: none !important;
}

/* Single-row layout */
.bd-header .container-xl,
.bd-header .container-fluid,
.bd-header .navbar-header-items,
.bd-header .navbar-header-items__start,
.bd-header .navbar-header-items__end {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

.bd-header .navbar-header-items {
  justify-content: space-between !important;
  width: 100%;
  gap: 1rem;
}

.bd-header .navbar-header-items__start {
  justify-content: flex-start !important;
  gap: 1.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

.bd-header .navbar-header-items__center {
  display: none !important;
}

.bd-header .navbar-header-items__end {
  justify-content: flex-end !important;
  gap: 0.7rem;
  margin-left: auto;
  flex: 0 0 auto;
}

/* =========================
   Brand
========================= */
.bd-header .navbar-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 0.9rem;
  margin-right: 2.4rem !important;
  padding-right: 0.35rem !important;
  white-space: nowrap;
  flex-shrink: 0 !important;
  text-decoration: none !important;
}

.bd-header .navbar-brand img {
  height: 56px;
  width: auto;
  max-height: 56px;
}

.bd-header .navbar-brand,
.bd-header .navbar-brand .title,
.bd-header .navbar-brand__title,
.bd-header .navbar-brand p,
.navbar-brand p {
  font-size: 1.24rem !important;
  font-weight: 600 !important;
  color: var(--hdmr-brand) !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.bd-header .navbar-brand:hover,
.bd-header .navbar-brand:focus,
.bd-header .navbar-brand:visited {
  color: var(--hdmr-brand) !important;
  text-decoration: none !important;
}

/* =========================
   Top Navigation
========================= */
.bd-header .navbar-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.55rem;
  margin: 0 !important;
  padding-left: 0 !important;
  min-width: 0;
}

.bd-header .navbar-nav .nav-item {
  white-space: nowrap;
  flex-shrink: 0;
}

.bd-header .navbar-nav .nav-item:first-child,
.bd-header .navbar-nav .nav-item:first-child .nav-link {
  margin-left: 0.35rem !important;
}

.bd-header .navbar-nav .nav-link,
.bd-header .navbar-nav .nav-link:visited,
.bd-header .navbar-nav .nav-link:hover,
.bd-header .navbar-nav .nav-link:focus,
.bd-header .navbar-nav .nav-link:active,
.bd-navbar-elements .nav-link,
.navbar-nav .nav-link {
  font-size: 1.16rem !important;
  font-weight: 400 !important;
  color: var(--hdmr-heading) !important;
  padding: 0.28rem 0.68rem !important;
  white-space: nowrap;
  letter-spacing: -0.02em;
  line-height: 1.1 !important;
  text-decoration: none !important;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.bd-header .navbar-nav .nav-link:hover,
.bd-header .navbar-nav .nav-link:focus,
.bd-header .navbar-nav .current > .nav-link,
.bd-header .navbar-nav .active > .nav-link,
.bd-navbar-elements .nav-link:hover,
.bd-navbar-elements .nav-link:focus {
  color: #1f2937 !important;
  text-decoration: none !important;
}

.bd-header .navbar-nav .nav-link::after,
.bd-header .navbar-nav .nav-item::after {
  display: none !important;
}

.bd-header .navbar-nav .dropdown-toggle,
.bd-header .navbar-nav .dropdown-toggle:visited,
.bd-header .navbar-nav .dropdown-toggle:hover,
.bd-header .navbar-nav .dropdown-toggle:focus {
  color: var(--hdmr-heading) !important;
}

/* Active underline */
.bd-header .navbar-nav .current > .nav-link,
.bd-header .navbar-nav .active > .nav-link {
  border-bottom: 3px solid var(--hdmr-accent) !important;
}

/* =========================
   Search
========================= */
.bd-search {
  margin-right: 0.15rem;
  flex-shrink: 0;
}

.bd-search .form-control,
.bd-search input,
.search-button__overlay__input {
  width: 80px !important;
  min-width: 80px !important;
  height: 36px !important;
  border-radius: 999px !important;
  border: 1px solid var(--hdmr-border) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-size: 0.88rem !important;
  padding-left: 0.78rem !important;
  padding-right: 0.78rem !important;
  color: var(--hdmr-heading) !important;
}

.bd-search .form-control:focus,
.bd-search input:focus,
.search-button__overlay__input:focus {
  border-color: #c7d0dc !important;
  box-shadow: none !important;
  outline: none !important;
}

.bd-search .form-control::placeholder,
.bd-search input::placeholder,
.search-button__overlay__input::placeholder {
  color: transparent !important;
}

/* Hide shortcut hints */
.search-button__kbd-shortcut,
.search-button kbd,
.bd-search kbd,
kbd.kbd-shortcut {
  display: none !important;
}

/* Hide duplicated search button if present */
.search-button__button {
  display: none !important;
}

/* =========================
   Icon links
========================= */
.navbar-icon-links,
.bd-header .navbar-icon-links {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem;
  flex-wrap: nowrap !important;
}

.navbar-icon-links a,
.navbar-icon-links a:visited,
.navbar-icon-links a:hover,
.navbar-icon-links a:focus,
.bd-header .navbar-icon-links a,
.bd-header .navbar-icon-links a:visited,
.bd-header .navbar-icon-links a:hover,
.bd-header .navbar-icon-links a:focus {
  color: var(--hdmr-icon) !important;
  font-size: 1.14rem;
  margin-left: 0 !important;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.navbar-icon-links a:hover,
.bd-header .navbar-icon-links a:hover {
  color: var(--hdmr-icon-hover) !important;
}

/* =========================
   Hide unwanted header controls
========================= */
.theme-switch-button,
button.theme-switch-button,
.navbar-theme-button {
  display: none !important;
}

.navbar-toggler {
  color: #5f6f8a !important;
  border: none !important;
  box-shadow: none !important;
  flex-shrink: 0;
}

/* =========================
   Base typography
========================= */
body,
.bd-content,
.bd-article-container,
p,
li {
  color: var(--hdmr-text) !important;
}

.bd-article-container h1,
.bd-article-container h2,
.bd-article-container h3,
.bd-article-container h4,
.bd-article-container h5 {
  color: var(--hdmr-heading) !important;
}

.bd-article-container h1 {
  font-size: 2.15rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.022em;
}

.bd-article-container h2 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.017em;
}

.bd-article-container h3 {
  font-size: 1.14rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.012em;
}

h1,
h2,
h3 {
  letter-spacing: -0.018em;
}

/* =========================
   Links: prevent purple visited/focus states
========================= */
.bd-content a,
.bd-content a:visited,
.bd-content a:hover,
.bd-content a:focus,
.bd-content a:active,
.bd-article-container a,
.bd-article-container a:visited,
.bd-article-container a:hover,
.bd-article-container a:focus,
.bd-article-container a:active,
a,
a:visited,
a:hover,
a:focus,
a:active {
  color: var(--hdmr-link) !important;
  text-decoration-color: currentColor !important;
}

.bd-content a:hover,
.bd-content a:focus,
.bd-article-container a:hover,
.bd-article-container a:focus,
a:hover,
a:focus {
  color: var(--hdmr-link-hover) !important;
}

/* Heading anchors */
a.headerlink,
a.headerlink:visited,
a.headerlink:hover,
a.headerlink:focus {
  color: transparent !important;
  display: none !important;
}

/* Headings containing anchor links */
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a,
h1 a:visited,
h2 a:visited,
h3 a:visited,
h4 a:visited,
h5 a:visited,
h6 a:visited {
  color: inherit !important;
  text-decoration: none !important;
}

/* =========================
   Breadcrumbs
========================= */
.bd-breadcrumbs,
.bd-breadcrumbs a,
.bd-breadcrumbs a:visited,
.bd-breadcrumbs a:hover,
.breadcrumb,
.breadcrumb a,
.breadcrumb a:visited,
.breadcrumb a:hover {
  color: #66758b !important;
}

/* =========================
   Sidebar
========================= */
/* Default: hide section navigation */
.bd-sidebar-primary,
.sidebar-primary-items__start,
.sidebar-primary-items__end {
  display: none !important;
}

/* Show only when enabled by JS on user guide pages */
body.show-user-guide-sidebar .bd-sidebar-primary,
body.show-user-guide-sidebar .sidebar-primary-items__start,
body.show-user-guide-sidebar .sidebar-primary-items__end {
  display: block !important;
}

.bd-sidebar,
.bd-sidebar-primary {
  background: #ffffff !important;
}

.bd-sidebar a,
.bd-sidebar a:visited,
.bd-sidebar a:hover,
.bd-sidebar a:focus,
.bd-sidebar .reference.internal,
.bd-sidebar .reference.internal:visited,
.bd-links__title,
.bd-sidenav a,
.bd-sidenav a:visited {
  color: #617086 !important;
  font-weight: 400 !important;
}

.bd-sidebar a:hover,
.bd-sidebar a:focus,
.bd-sidebar .reference.internal:hover,
.bd-sidenav a:hover {
  color: var(--hdmr-accent) !important;
}

.bd-sidebar .current > a,
.bd-sidebar .current > .reference.internal,
.bd-sidenav .current > a {
  color: var(--hdmr-accent) !important;
  font-weight: 500 !important;
}

.bd-sidebar .caption,
.bd-links__title,
.sidebar-primary-item .sidebar-header-items__title {
  color: var(--hdmr-heading) !important;
}

/* =========================
   Hide secondary sidebar completely
========================= */
.bd-sidebar-secondary,
.bd-sidebar-secondary-primary,
.secondary-sidebar {
  display: none !important;
  border-left: none !important;
  box-shadow: none !important;
}

.bd-sidebar-secondary::before,
.bd-sidebar-secondary::after,
.bd-sidebar-secondary-primary::before,
.bd-sidebar-secondary-primary::after,
.secondary-sidebar::before,
.secondary-sidebar::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

/* Hide Show Source / Edit buttons in the secondary sidebar */
.editthispage,
.editthispage a,
.bd-sidebar-secondary .tocsection,
.bd-sidebar-secondary .theme-switch-button,
.bd-sidebar-secondary .sourcelink,
.bd-sidebar-secondary .editthispage,
a[href*="_sources/"],
a[href$=".md.txt"],
a[href$=".rst.txt"] {
  display: none !important;
}

/* =========================
   Cards / code blocks / surfaces
========================= */
.sd-card {
  border-radius: 14px;
  border: 1px solid var(--hdmr-border) !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

.sd-card:hover {
  border-color: #cfd6df !important;
  transition: border-color 0.18s ease;
}

div.highlight,
.bd-content .highlight,
.highlight pre,
pre {
  background: var(--hdmr-code-bg) !important;
  border-color: var(--hdmr-border) !important;
}

div.highlight pre {
  padding: 0.9rem;
  border-radius: 10px;
}

code,
kbd,
pre {
  color: var(--hdmr-heading) !important;
}

/* Inline code */
code.literal,
:not(pre) > code {
  background: #f2f4f7 !important;
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  padding: 0.08rem 0.3rem;
}

/* Admonitions / panels */
.admonition,
.note,
.warning,
.tip,
.important {
  background: var(--hdmr-surface) !important;
  border-color: var(--hdmr-border) !important;
}

/* =========================
   Hide rightmost sidebar/toc toggle icon
========================= */
.sidebar-toggle,
.primary-toggle,
.secondary-toggle,
button.sidebar-toggle,
button.primary-toggle,
button.secondary-toggle,
label.sidebar-toggle,
label.primary-toggle,
label.secondary-toggle {
  display: none !important;
}

/* =========================
   Responsive
========================= */
@media (max-width: 1280px) {
  .bd-header .navbar-nav {
    display: flex !important;
  }
}

@media (max-width: 1080px) {
  .bd-header .navbar-nav {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .navbar-icon-links,
  .bd-header .navbar-icon-links {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .bd-search {
    display: none !important;
  }

  .bd-header .navbar-brand img {
    height: 46px;
    max-height: 46px;
  }

  .bd-header .navbar-brand,
  .bd-header .navbar-brand .title,
  .bd-header .navbar-brand__title,
  .bd-header .navbar-brand p,
  .navbar-brand p {
    font-size: 1.08rem !important;
  }

  .bd-article-container h1 {
    font-size: 1.9rem !important;
  }

  .bd-article-container h2 {
    font-size: 1.35rem !important;
  }

  .bd-article-container h3 {
    font-size: 1.05rem !important;
  }
}