﻿:root {
  --sprout-header-height: 68px;
  --sprout-nav-width: 340px;

  --sprout-bg: #f5f7fa;
  --sprout-surface: #ffffff;
  --sprout-surface-soft: #f8fafc;

  --sprout-border: #dee2e6;
  --sprout-border-soft: #edf1f5;

  --sprout-text: #1f2937;
  --sprout-muted: #6b7280;
  --sprout-heading: #111827;

  --sprout-blue-dark: #1e448f;
  --sprout-blue: #2e6cec;
  --sprout-green: #589903;

  --sprout-shadow-sm: 0 .125rem .25rem rgba(17, 24, 39, .06);
  --sprout-shadow: 0 .5rem 1.25rem rgba(17, 24, 39, .08);

  --sprout-radius: .75rem;
  --sprout-radius-sm: .5rem;
  --sprout-sidebar-item-radius: .5rem;

  --sprout-transition: all .18s ease;
}

/* Utility */
.unselectable {
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.element-invisible {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sprout-bg);
  color: var(--sprout-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sm-nav-expanded {
  overflow: hidden;
}

/* Skip link */
#skip-link a {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
}

#skip-link a:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  color: var(--sprout-text);
  border: 1px solid var(--sprout-border);
  border-radius: .5rem;
  padding: .75rem 1rem;
  box-shadow: var(--sprout-shadow);
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sprout-header-height);
  min-height: var(--sprout-header-height);
  z-index: 1035;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sprout-border);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .03);
}

header .hnd-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--sprout-border);
  border-radius: .5rem;
  background: #fff;
  box-shadow: none;
  transition: var(--sprout-transition);
  color: var(--sprout-text);
  font-weight: 500;
}

header .hnd-toggle .bi {
  font-size: 1rem;
  line-height: 1;
}

header .hnd-toggle .toggle-label {
  font-size: .92rem;
  line-height: 1;
}

header .hnd-toggle:hover,
header .hnd-toggle:focus,
header .hnd-toggle:active,
header .hnd-toggle.active {
  background: var(--sprout-surface-soft);
  border-color: #cfd6de;
  box-shadow: none;
}

/* Show the Contents button only when TOC is closed */
body:not(.md-nav-expanded) header .hnd-toggle,
body.sm-nav-expanded header .hnd-toggle {
  display: inline-flex;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  flex: 0 0 auto;
}

.header-brand-logo img {
  height: 42px;
  width: auto;
  display: block;
}

.header-brand-text {
  min-width: 0;
}

.header-app-subtitle {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sprout-heading);
  white-space: nowrap;
}

/* remove legacy header title styling if still present */
header h1,
.header-app-name {
  display: none;
}


/* Left panel */
nav {
  position: fixed;
  top: var(--sprout-header-height);
  left: calc(-1 * var(--sprout-nav-width));
  bottom: 0;
  width: var(--sprout-nav-width);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  background: var(--sprout-surface);
  border-right: 1px solid var(--sprout-border);
  box-shadow: 1px 0 0 rgba(17,24,39,.03);
  transition: left .22s ease, opacity .22s ease;
}



body.md-nav-expanded nav {
  left: 0;
  opacity: 1;
}

body.sm-nav-expanded nav {
  left: 0;
  opacity: 1;
}

@media screen and (max-width: 768px) {
  nav {
    width: min(90vw, 340px) !important;
    left: -100%;
    box-shadow: 0 1rem 2rem rgba(0,0,0,.18);
    z-index: 1050;
  }
}

@media screen and (min-width: 769px) {
  body.md-nav-expanded header {
    padding-left: 1rem !important;
  }
}

/* Mobile mask */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  opacity: 0;
  visibility: hidden;
  z-index: 1045;
  transition: opacity .2s ease, visibility .2s ease;
}

body.sm-nav-expanded .mask {
  opacity: 1;
  visibility: visible;
}

/* Nav tabs */
nav .tab-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: .35rem .5rem 0 .5rem;
  list-style: none;
  border-bottom: 1px solid var(--sprout-border);
  background: var(--sprout-surface);
}

nav .tab-tabs > li {
  margin: 0;
}

nav .tab-tabs > li.tab {
  flex: 1 1 auto;
}

nav .tab-tabs > li > a,
nav .tab-tabs .hnd-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .75rem .9rem;
  border: 0;
  border-radius: .6rem .6rem 0 0;
  background: transparent;
  color: var(--sprout-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--sprout-transition);
}

nav .tab-tabs > li > a:hover,
nav .tab-tabs > li > a:focus,
nav .tab-tabs .hnd-toggle:hover,
nav .tab-tabs .hnd-toggle:focus {
  background: var(--sprout-surface-soft);
  color: var(--sprout-text);
}

nav .tab-tabs > li.active > a,
nav .tab-tabs > li.active > a:hover,
nav .tab-tabs > li.active > a:focus {
  background: var(--sprout-surface-soft);
  color: var(--sprout-heading);
}

nav .tab-tabs > li.tab::after {
  content: "";
  display: block;
  height: 3px;
  margin: 0 .6rem;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

nav .tab-tabs > li.active.tab::after {
  background: currentColor;
}

#nav-close {
  flex: 0 0 auto;
}

#nav-close .hnd-toggle {
  border-radius: .5rem;
  min-width: 44px;
}

/* Search info */
nav #search-info {
  margin: .75rem 1rem 0 1rem;
  padding-left: .75rem;
  border-left: 3px solid var(--sprout-border);
  color: var(--sprout-muted);
  font-size: .875rem;
}

/* Nav content */
nav .tab-content,
nav .tree-container,
nav .keywords-container,
nav .search-container,
nav .searchbox,
nav .search-box,
nav .search-form {
  min-height: 0;
}

nav .tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

nav .tab-pane,
nav .tree-panel,
nav .keywords-panel,
nav .search-panel {
  height: 100%;
  min-height: 0;
  padding: .75rem .75rem 1rem .75rem;
  overflow: auto;
}

.toc-tools {
  display: flex;
  gap: .5rem;
  padding: .5rem .75rem 0 .75rem;
  flex-wrap: wrap;
}

.toc-tools .btn {
  font-size: .8rem;
  line-height: 1.2;
}

#contents .tree-container {
  margin-top: .5rem;
}


/* Main shell */
div#main {
  min-height: 100vh;
  padding-top: var(--sprout-header-height);
  transition: margin-left .22s ease;
}

@media screen and (min-width: 769px) {
  body.md-nav-expanded div#main {
    margin-left: var(--sprout-nav-width);
  }
}

@media screen and (max-width: 768px) {
  div#main {
    margin-left: 0 !important;
  }

  header {
    padding-left: 1rem !important;
  }
}

/* Main article */
div#main > article {
  max-width: 1180px;
  margin: 1.25rem auto 2rem auto;
  padding: 0 1rem;
}

div#main > article > .navigation,
div#main > article > #topic-content,
div#main > article > #topic_footer {
  background: var(--sprout-surface);
  border: 1px solid var(--sprout-border);
  box-shadow: var(--sprout-shadow-sm);
}

div#main > article > .navigation {
  border-radius: var(--sprout-radius) var(--sprout-radius) 0 0;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--sprout-border-soft);
}

div#main > article > #topic-content {
  border-top: 0;
  border-bottom: 0;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
}

div#main > article > #topic_footer {
  border-top: 1px solid var(--sprout-border-soft);
  border-radius: 0 0 var(--sprout-radius) var(--sprout-radius);
  padding: 1rem 1.5rem;
  color: var(--sprout-muted);
  font-size: .55rem;
}

@media screen and (max-width: 768px) {
  div#main > article {
    margin: .75rem auto 1.25rem auto;
    padding: 0 .75rem;
  }

  div#main > article > .navigation {
    border-radius: .75rem .75rem 0 0;
    padding: .75rem .875rem;
  }

  div#main > article > #topic-content {
    padding: 1.1rem 1rem 1.4rem 1rem;
  }

  div#main > article > #topic_footer {
    padding: .9rem 1rem;
    border-radius: 0 0 .75rem .75rem;
  }
}

/* Breadcrumb / navigation row */
div#main > article .navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

div#main > article .navigation .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  background: transparent;
  list-style: none;
}

div#main > article .navigation .breadcrumb > li {
  display: inline-flex;
  align-items: center;
  color: var(--sprout-muted);
  font-size: .92rem;
}

div#main > article .navigation .breadcrumb > li a {
  color: inherit;
  text-decoration: none;
}

div#main > article .navigation .breadcrumb > li a:hover {
  text-decoration: underline;
}

div#main > article .navigation .breadcrumb > li::after {
  content: "/";
  margin-left: .4rem;
  color: #c0c7d1;
}

div#main > article .navigation .breadcrumb > li:last-child::after {
  display: none;
}

div#main > article .navigation .nav-arrows {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

div#main > article .navigation .nav-arrows a,
div#main > article .navigation .nav-arrows button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: .375rem .7rem;
  border: 1px solid var(--sprout-border);
  border-radius: .5rem;
  background: #fff;
  color: var(--sprout-text);
  box-shadow: none;
  text-decoration: none;
  transition: var(--sprout-transition);
}

div#main > article .navigation .nav-arrows a:hover,
div#main > article .navigation .nav-arrows a:focus,
div#main > article .navigation .nav-arrows button:hover,
div#main > article .navigation .nav-arrows button:focus {
  background: var(--sprout-surface-soft);
  text-decoration: none;
}

/* Inline TOC */
div#main > article .navigation .nav-arrows #inline-toc {
  max-width: min(90vw, 420px);
}

div#main > article .navigation .nav-arrows #inline-toc ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
}

div#main > article .navigation .nav-arrows #inline-toc ul li {
  margin-bottom: .35rem;
  list-style: disc;
}

/* Topic content */
#topic-content {
  padding: 0;
}

#topic-content img {
  max-width: 100%;
  height: auto;
  vertical-align: baseline;
}

#topic-content table {
  border-collapse: separate;
}

.topic-content-inner > :first-child {
  margin-top: 0;
}

/* Splitter */
#hnd-splitter {
  position: fixed;
  top: var(--sprout-header-height);
  bottom: 0;
  width: 10px;
  z-index: 1041;
  cursor: col-resize;
  background: transparent;
}

#hnd-splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: var(--sprout-transition);
}

#hnd-splitter:hover::after {
  background: #cdd5df;
}

@media screen and (max-width: 768px) {
  #hnd-splitter {
    display: none !important;
  }
}

/* jsTree */
.jstree {
  font-size: .95rem;
}

.jstree .jstree-children {
  margin-left: 1rem;
  padding-left: .35rem;
  border-left: 1px solid #e5e7eb;
}

.jstree .jstree-container-ul {
  margin-top: .25rem;
}

.jstree .jstree-node {
  margin-left: 0;
}

.jstree .jstree-anchor {
  height: auto;
  line-height: 1.35;
  padding: .35rem .55rem;
  margin: .08rem 0;
  border: 1px solid transparent;
  border-radius: var(--sprout-sidebar-item-radius);
  color: var(--sprout-text);
  text-shadow: none;
  white-space: normal;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  vertical-align: middle;
}

.jstree .jstree-anchor:hover,
.jstree .jstree-hovered {
  background: var(--sprout-surface-soft) !important;
  border-color: transparent !important;
  box-shadow: none;
}

.jstree .jstree-anchor > .jstree-themeicon,
.jstree .jstree-anchor > .jstree-icon {
  flex: 0 0 auto;
}

.jstree .jstree-clicked {
  background: #eef6ea !important;
  border-color: #d7e6cf !important;
  color: #234b11 !important;
  box-shadow: none;
  position: relative;
  font-weight: 600;
}

.jstree .jstree-clicked::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--sprout-green);
}

.jstree-default .jstree-wholerow-clicked,
.jstree-default .jstree-wholerow-hovered {
  background: transparent;
}

.jstree .jstree-icon {
  background-image: none !important;
}

/* Expand/collapse chevrons */
.jstree .jstree-node.jstree-closed > .jstree-icon.jstree-ocl,
.jstree .jstree-node.jstree-open > .jstree-icon.jstree-ocl {
  position: relative;
  background: none !important;
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-right: .25rem;
  vertical-align: middle;
}

.jstree .jstree-node.jstree-closed > .jstree-icon.jstree-ocl::before,
.jstree .jstree-node.jstree-open > .jstree-icon.jstree-ocl::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--sprout-muted);
  transition: transform .15s ease, border-left-color .15s ease;
  position: relative;
  top: 1px;
}

.jstree .jstree-node.jstree-open > .jstree-icon.jstree-ocl::before {
  transform: rotate(90deg);
}

.jstree .jstree-node.jstree-closed > .jstree-icon.jstree-ocl:hover::before,
.jstree .jstree-node.jstree-open > .jstree-icon.jstree-ocl:hover::before {
  border-left-color: var(--sprout-text);
}

/* Topic icons: let Bootstrap Icons render their own glyphs */
.jstree .jstree-themeicon {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  margin-right: .35rem;
  background: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  font-size: 1rem;
}

.jstree .jstree-themeicon.bi::before {
  color: var(--sprout-muted);
  font-size: .95rem;
  line-height: 1;
}

.jstree .jstree-hovered .jstree-themeicon.bi::before,
.jstree .jstree-anchor:hover .jstree-themeicon.bi::before {
  color: var(--sprout-blue-dark);
}

.jstree .jstree-clicked .jstree-themeicon.bi::before {
  color: #3f6f02;
}


/* Related links / modals */
.modal-body .relative-list {
  margin: 0;
  padding: 0;
}

.modal-body .relative-list li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-body .relative-list li a {
  display: block;
  padding: .55rem .6rem;
  color: var(--sprout-text);
  border-radius: .5rem;
  text-decoration: none;
}

.modal-body .relative-list li a:hover {
  background: var(--sprout-surface-soft);
  text-decoration: none;
}

@media screen and (max-width: 768px) {
  .modal-body .relative-list li {
    font-size: 1rem;
    font-weight: 600;
  }

  .modal-body .relative-list li a {
    padding: .8rem .7rem;
  }
}

/* Print-friendly shell */
@media print {
  header,
  nav,
  #hnd-splitter,
  .mask,
  .navigation .nav-arrows {
    display: none !important;
  }

  body,
  div#main,
  div#main > article,
  div#main > article > #topic-content {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
  }
}