:root {
  --brand: #e51b23;
  --brand-dark: #b9141b;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --code: #f5f6f8;
  --max-width: 1480px;
  --sidebar: 270px;
  --toc: 230px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.docs-header__inner {
  max-width: var(--max-width);
  min-height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.docs-brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.docs-brand img {
  width: 116px;
  height: auto;
  display: block;
}

.docs-brand span {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.docs-search {
  flex: 1;
  max-width: 620px;
  margin-left: auto;
}

.docs-search form {
  margin: 0;
}

.docs-search input[type="text"],
.docs-search input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px 8px 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
}

.docs-search__placeholder {
  min-height: 42px;
  padding: 9px 14px 9px 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: #98a2b3;
  font-size: 14px;
}

.docs-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
  gap: 44px;
  padding: 32px 24px 80px;
}

.docs-sidebar,
.docs-toc {
  min-width: 0;
}

.docs-sidebar__inner,
.docs-toc__inner {
  position: sticky;
  top: 100px;
}

.docs-sidebar__title,
.docs-toc__title {
  margin-bottom: 14px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-sidebar li {
  margin: 2px 0;
}

.docs-sidebar a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: #475467;
  font-size: 14px;
}

.docs-sidebar a:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
  text-decoration: none;
}

.docs-main {
  min-width: 0;
}

.docs-breadcrumbs {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13px;
}

.docs-content {
  max-width: 850px;
}

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  color: #101828;
  line-height: 1.25;
  scroll-margin-top: 100px;
}

.docs-content h1 {
  margin: 0 0 24px;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.03em;
}

.docs-content h2 {
  margin-top: 48px;
  font-size: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.docs-content h3 {
  margin-top: 34px;
  font-size: 21px;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  margin: 0 0 18px;
}

.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.docs-content pre {
  overflow-x: auto;
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code);
  font-size: 13px;
  line-height: 1.6;
}

.docs-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--code);
  font-size: 0.9em;
}

.docs-content pre code {
  padding: 0;
  background: transparent;
}

.docs-content blockquote {
  margin: 24px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--brand);
  background: #fff6f6;
  color: #475467;
}

.docs-toc nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-toc nav a {
  display: block;
  padding: 4px 0;
  color: #667085;
  font-size: 13px;
}

.docs-toc nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

.docs-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 28px 24px;
  color: var(--muted);
  font-size: 13px;
}

#portal-globalnav>ul,
#portal-globalnav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#portal-globalnav li {
  margin: 0;
}

#portal-globalnav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
}

#portal-globalnav a:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

#portal-searchbox label,
#portal-searchbox .searchSection {
  display: none;
}

/* Language selector */
#theme-language {
  flex: 0 0 auto;
}

#theme-language #portal-languageselector {
  display: flex;
  align-items: center;
  gap: 4px;

  margin: 0;
  padding: 0;

  list-style: none;
}

#theme-language #portal-languageselector li {
  display: block;

  margin: 0;
  padding: 0;

  list-style: none;
}

#theme-language #portal-languageselector a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 38px;
  height: 36px;
  padding: 0 9px;

  border: 1px solid transparent;
  border-radius: 7px;

  background: transparent;
  color: var(--text-muted);

  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;

  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease;
}

#theme-language #portal-languageselector a:hover {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
}

#theme-language #portal-languageselector li.currentLanguage a {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#theme-language #portal-languageselector li.currentLanguage a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Collection / Latest articles */
.entries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entries > article {
  display: block !important;

  margin: 0 !important;
  padding: 1rem 1.25rem !important;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface);

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.entries > article:hover {
  border-color: rgba(0, 123, 177, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Cancel Bootstrap row/col */
.entries > article > .col {
  padding: 0 !important;
}

/* Title */
.entries > article .mb-1:first-child {
  margin: 0 !important;
}

.entries > article .mb-1:first-child a {
  color: var(--brand);
  text-decoration: none;

  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.entries > article .mb-1:first-child a:hover {
  text-decoration: underline;
}

/* Hide metadata */
.entries > article .mb-1:nth-child(2) {
  display: none !important;
}

#portal-footer-wrapper {
  margin: 0;
}

/* Documentation navigation */
#theme-navigation li {
  position: relative;
}

/* Hide the real checkbox */
#theme-navigation li .opener {
  display: none;
}

/* Submenus are normally closed */
#theme-navigation li>ul {
  height: 0;
  visibility: hidden;
  opacity: 0;
  overflow: hidden;
  padding-left: 1rem;
  transition: all 0.2s ease;
}

/* Manually opened */
#theme-navigation li .opener:checked~ul {
  height: auto;
  visibility: visible;
  opacity: 1;
}

/* Automatically open the branch containing the current page */
#theme-navigation li:has(a[aria-current="page"])>ul {
  height: auto;
  visibility: visible;
  opacity: 1;
}

/* Arrow / click area */
#theme-navigation li label {
  position: absolute;
  right: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

#theme-navigation li label::after {
  content: "›";
  display: block;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

/* Rotate arrow when manually opened */
#theme-navigation li .opener:checked+label::after {
  transform: rotate(90deg);
}

/* Rotate arrow for the current branch */
#theme-navigation li:has(a[aria-current="page"])>label::after {
  transform: rotate(90deg);
}

/* Table listing */
#content .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#content .table-responsive>table.table {
  width: 100%;
  margin-bottom: 1rem;
  vertical-align: top;
  border-color: var(--border);
  border-collapse: collapse;
}

/* Cells */
#content .table-responsive>table.table> :not(caption)>*>* {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

/* Header */
#content .table-responsive>table.table>thead>tr>th {
  font-weight: 600;
  color: var(--text);
  background: var(--surface-soft);
  white-space: nowrap;
}

/* Striped rows */
#content .table-responsive>table.table.table-striped>tbody>tr:nth-of-type(odd)>* {
  background: var(--surface-soft);
}

/* Hover */
#content .table-responsive>table.table>tbody>tr:hover>* {
  background: var(--surface-hover);
}

/* Links */
#content .table-responsive>table.table a {
  color: var(--brand);
  text-decoration: none;
}

#content .table-responsive>table.table a:hover {
  text-decoration: underline;
}

/* Hide table extra columns */
#content .table-responsive>table.table th:nth-child(3),
#content .table-responsive>table.table td:nth-child(3),
#content .table-responsive>table.table th:nth-child(5),
#content .table-responsive>table.table td:nth-child(5),
#content .table-responsive>table.table th:nth-child(6),
#content .table-responsive>table.table td:nth-child(6) {
  display: none;
}

/* Hide author from article */
#viewlet-below-content-title {
  display: none;
}

/* Search panel */
#theme-search {
  width: min(100%, 620px);
}

#theme-search #portal-searchbox {
  width: 100%;
}

#theme-search #searchGadget_form {
  position: relative;
  display: flex !important;
  margin: 0;
}

/* Search input */
#theme-search #searchGadget {
  width: 100%;
  height: 44px;
  box-sizing: border-box;

  margin: 0 !important;
  padding: 0 16px;

  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0 10px;

  background: var(--surface);
  color: var(--text);

  font-size: 15px;
  line-height: 44px;

  outline: none;
  box-shadow: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

#theme-search #searchGadget::placeholder {
  color: var(--text-muted);
}

#theme-search #searchGadget:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 123, 177, 0.08);
  outline: none;
}

/* Search button */
#theme-search .searchButton {
  flex: 0 0 92px;

  height: 44px;

  margin: 0;
  padding: 0 18px;

  border: 1px solid var(--brand);
  border-radius: 0 10px 10px 0;

  background: var(--brand);
  color: #fff;

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

#theme-search .searchButton:hover {
  background: var(--brand-dark, #006894);
  border-color: var(--brand-dark, #006894);
}

/* Hide Advanced Search */
#theme-search #portal-advanced-search {
  display: none !important;
}

/* Search results */
/* Search page form */
#searchform>.input-group {
  display: none;
}

/* Search heading */
#search-term {
  margin: 2rem 0 0.75rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}

#search-term .text-muted {
  color: var(--brand) !important;
}

/* Results toolbar */
#search-results-wrapper+* {
  margin-top: 1rem;
}

#searchform>.d-flex.mb-2 {
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

#results-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

#search-results-number {
  display: inline !important;
  min-width: auto;
  height: auto;
  margin: 0 0.25rem 0 0 !important;
  padding: 0;

  background: transparent !important;
  color: var(--text-muted) !important;

  font-size: inherit;
  font-weight: 600;
}

/* Filter */
#search-filter {
  display: none;
}

/* Search results */
#search-results .searchResults {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  margin: 0;
  padding: 0;

  list-style: none;
  counter-reset: none;
}

/* Individual result */
#search-results .searchResults>li {
  display: block !important;

  margin: 0;
  padding: 1rem 1.25rem;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface);

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

#search-results .searchResults>li:hover {
  border-color: rgba(0, 123, 177, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Result title */
#search-results .result-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

#search-results .result-title a {
  color: var(--brand);
  text-decoration: none;
}

#search-results .result-title a:hover {
  text-decoration: underline;
}

/* Author / dates */
#search-results .documentAuthor,
#search-results .documentPublished,
#search-results .documentModified {
  display: none;
}

#search-results .searchResults small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Location */
#search-results .searchResults cite {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-style: normal;
}

#search-results .searchResults cite a {
  color: var(--text-muted);
  text-decoration: none;
}

#search-results .searchResults cite a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* Remove the empty right-side link from the result */
#search-results .searchResults>li>a:last-child {
  display: none;
}

/* RSS */
#rss-subscription {
  display: none;
}

/* Sorting */
#sorting-options {
  display: none;
}

#searchform .nav-link {
  display: none;
}

/* Search pagination */
#search-results-wrapper+nav,
#search-results-wrapper~nav {
  margin-top: 1.5rem;
}

#content .pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

#content .pagination .page-item {
  margin: 0;
}

#content .pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 36px;
  height: 36px;
  padding: 0 0.65rem;

  border: 1px solid var(--border);
  border-radius: 7px;

  background: var(--surface);
  color: var(--text);

  font-size: 0.9rem;
  text-decoration: none;
}

#content .pagination .page-link:hover {
  border-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand);
}

#content .pagination .page-item.active .page-link {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

#content .pagination .page-item.next .page-link {
  gap: 0.4rem;
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

#content .pagination .page-item.next .label {
  font-size: 0.85rem;
}

#content .pagination .page-item.next .page-link>span[aria-hidden="true"] {
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 30px;
  }

  .docs-toc {
    display: none;
  }

  :root {
    --sidebar: 230px;
  }
}

@media (max-width: 760px) {
  #theme-language {
    margin-left: auto;
  }

  .docs-header__inner {
    min-height: 60px;
    padding: 0 16px;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .docs-brand span {
    display: none;
  }

  .docs-brand img {
    width: 104px;
  }

  .docs-search {
    flex: 0 0 100%;
    max-width: none;
    margin-left: 0;
    order: 3;
  }

  .docs-layout {
    display: block;
    padding: 22px 16px 60px;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-content h1 {
    font-size: 34px;
  }
}