:root {
  --vex-red: #d22630;
  --manual-bg: #f4f5f7;
  --manual-surface: #ffffff;
  --manual-surface-soft: #fafafa;
  --manual-text: #1f2328;
  --manual-muted: #515b66;
  --manual-line: #d9dee5;
  --manual-shadow: 0 18px 45px rgba(31, 35, 40, 0.08);
  --manual-link: #9f1720;
  --manual-link-hover: #791019;
  --manual-accent-text: #a9151f;
  --manual-nav-height: 76px;
  --bs-primary: var(--vex-red);
  --bs-primary-rgb: 210, 38, 48;
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --manual-bg: #111214;
  --manual-surface: #191b1f;
  --manual-surface-soft: #202328;
  --manual-text: #f4f5f7;
  --manual-muted: #c4ccd6;
  --manual-line: #343941;
  --manual-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --manual-link: #ff8f95;
  --manual-link-hover: #ffc2c5;
  --manual-accent-text: #ff858b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--manual-nav-height) + 20px);
}

body {
  min-height: 100vh;
  background: var(--manual-bg);
  color: var(--manual-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--manual-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus {
  color: var(--manual-link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  transform: translateY(-140%);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  background: var(--vex-red);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
  color: #ffffff;
}

.manual-navbar {
  min-height: var(--manual-nav-height);
  border-bottom: 1px solid var(--manual-line);
  background: var(--manual-surface);
  box-shadow: 0 8px 24px rgba(31, 35, 40, 0.05);
}

.manual-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--vex-red);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.manual-brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.1;
  font-size:1.5rem;
}

.manual-brand-text strong {
  color: var(--manual-text);
  font-size: 1rem;
  font-weight: 900;
}

.manual-brand-text span {
  color: var(--manual-muted);
  font-size: 0.78rem;
  font-weight: 750;
  font-size:1.5rem;
}

.manual-search {
  position: relative;
  width: min(640px, 100%);
}

.manual-search .input-group {
  min-width: 0;
}

.manual-search .form-control,
.manual-search .input-group-text {
  border-color: var(--manual-line);
  background: var(--manual-surface-soft);
  color: var(--manual-text);
}

.manual-search .form-control:focus {
  border-color: var(--vex-red);
  box-shadow: 0 0 0 0.2rem rgba(210, 38, 48, 0.18);
}

.manual-icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 8px;
  border-color: var(--manual-line);
  background: var(--manual-surface-soft);
  color: var(--manual-text);
}

.manual-icon-button:hover,
.manual-icon-button:focus {
  border-color: var(--vex-red);
  color: var(--manual-accent-text);
}

.manual-shell {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  width: 100%;
  margin: 0 auto;
}

.manual-sidebar {
  position: sticky;
  top: var(--manual-nav-height);
  height: calc(100vh - var(--manual-nav-height));
  overflow: auto;
  border-right: 1px solid var(--manual-line);
  background: var(--manual-surface);
  padding: 1rem;
}

.manual-sidebar-title,
.manual-results-title {
  margin: 0 0 0.6rem;
  color: var(--manual-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-toc {
  display: grid;
  gap: 0.15rem;
}

.manual-toc a {
  display: block;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  padding: 0.42rem 0.55rem;
  color: var(--manual-muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}


.manual-toc a[data-level="2"] {
  font-size:1.8rem}

.manual-toc a[data-level="3"] {
  padding-left: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.manual-toc a:hover,
.manual-toc a:focus,
.manual-toc a.active {
  border-left-color: var(--vex-red);
  background: rgba(210, 38, 48, 0.08);
  color: var(--manual-text);
}

.manual-main {
  min-width: 0;
  padding: clamp(1rem, 2.6vw, 2rem);
}

.manual-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 5px solid var(--vex-red);
  padding: clamp(1.2rem, 3vw, 2.25rem);
  background: var(--manual-surface);
  box-shadow: var(--manual-shadow);
}

.manual-hero-logo {
  width: min(340px, 100%);
  margin-bottom: 1rem;
}

.manual-kicker {
  margin: 0 0 0.35rem;
  color: var(--manual-accent-text);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-hero h1 {
  margin: 0;
  color: var(--manual-text);
  font-size: clamp(2rem, 4vw, 4.4rem);
  font-weight: 950;
  line-height: 0.96;
}

.manual-hero-copy {
  margin: 0.9rem 0 0;
  max-width: 72ch;
  color: var(--manual-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.manual-hero-figure {
  margin: 0;
  text-align: center;
}

.manual-hero-figure img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.manual-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
  border: 1px solid var(--manual-line);
  background: var(--manual-surface);
}

.manual-meta-strip div {
  min-width: 0;
  border-right: 1px solid var(--manual-line);
  padding: 0.85rem 1rem;
}

.manual-meta-strip div:last-child {
  border-right: 0;
}

.manual-meta-strip span {
  display: block;
  color: var(--manual-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-meta-strip strong {
  display: block;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  font-size: 2rem;
}

.manual-search-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  left: 0;
  z-index: 1040;
  max-height: min(68vh, 560px);
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--manual-line);
  border-radius: 8px;
  background: var(--manual-surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.manual-search-panel[hidden] {
  display: none;
}

.manual-search-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--manual-line);
  padding: 0.85rem 1rem;
}

.manual-search-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.manual-search-list {
  display: grid;
  gap: 0.4rem;
  max-height: min(54vh, 460px);
  overflow: auto;
  padding: 0.8rem;
}

.manual-search-result {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--manual-line);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--manual-surface-soft);
  color: var(--manual-text);
  text-decoration: none;
}

.manual-search-result:hover,
.manual-search-result:focus,
.manual-search-result.is-active {
  border-color: var(--vex-red);
  color: var(--manual-text);
}

.manual-search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.manual-search-result-label {
  color: var(--manual-text);
  font-size: 1.5rem;
}

.manual-search-result-badge {
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  background: rgba(210, 38, 48, 0.12);
  color: var(--manual-accent-text);
  font-size: 1rem;
  font-weight: 850;
  text-transform: uppercase;
}

.manual-search-result-section,
.manual-search-result-snippet {
  color: var(--manual-muted);
}

.manual-search-result-section {
  font-size: 1.5rem!important;
}

.manual-search-result-snippet {
  font-size: 1.3rem!important;
  line-height: 1.35;
}

.manual-search-panel .text-body-secondary {
  color: var(--manual-muted) !important;
}

.manual-notice {
  margin-bottom: 1rem;
  border: 1px solid var(--manual-line);
  background: var(--manual-surface);
}

.manual-notice summary {
  cursor: pointer;
  padding: 0.9rem 1rem;
  color: var(--manual-text);
  font-weight: 850;
}

.manual-notice-body {
  display: grid;
  gap: 0.8rem;
  border-top: 1px solid var(--manual-line);
  padding: 1rem;
  color: var(--manual-muted);
  font-size: 1.3rem!important;
  line-height: 1.55;
}

.manual-notice-body p {
  margin: 0;
}

.manual-notice summary{
  font-size:1.5em!important;
}


.manual-content {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--manual-surface);
  padding: clamp(1rem, 3vw, 2.5rem);
  box-shadow: var(--manual-shadow);
}

.manual-content > div:empty,
.manual-content p:empty {
  display: none;
}

.manual-content h2,
.manual-content h3,
.manual-content h4 {
  color: var(--manual-text);
  letter-spacing: 0;
  scroll-margin-top: calc(var(--manual-nav-height) + 20px);
}

.manual-content h2 {
  margin: 2.5rem 0 1rem;
  border-bottom: 4px solid var(--vex-red);
  padding-bottom: 0.45rem;
  font-size: clamp(1.7rem, 3vw, 5rem);
  font-weight: 950;
}

.manual-content h3 {
  margin: 2rem 0 0.85rem;
  color: var(--manual-accent-text);
  font-size: clamp(1.25rem, 2.1vw, 3rem);
  font-weight: 900;
}

.manual-content h4 {
  margin: 1.45rem 0 0.65rem;
  font-size: 2rem;
  font-weight: 900;
}

.manual-content p,
.manual-content li {
  color: var(--manual-text);
  font-size: 1rem;
  line-height: 1.68;
}

.manual-content p {
  margin: 0 0 0.85rem;
}

.manual-content ul,
.manual-content ol {
  margin: 0 0 1rem 1.35rem;
  padding: 0;
}

.manual-content li + li {
  margin-top: 0.35rem;
}

.manual-content p:has(.manual-rule-summary),
.manual-content p:has(.manual-term > a[id]),
.manual-content p:has(a[id] + .manual-term) {
  margin-top: 1.45rem;
  margin-bottom: 1rem;
}

.manual-content li:has(> a[id]),
.manual-content li:has(> span > a[id]) {
  margin-top: 0.75rem;
  padding-top: 0.35rem;
}

.manual-content h2 + p:has(.manual-rule-summary),
.manual-content h3 + p:has(.manual-rule-summary),
.manual-content h4 + p:has(.manual-rule-summary),
.manual-content p:has(.manual-rule-summary):first-child,
.manual-content li:first-child:has(> a[id]),
.manual-content li:first-child:has(> span > a[id]) {
  margin-top: 0;
}

.manual-page-title {
  margin: 2rem 0 0.4rem;
  color: var(--manual-muted);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-callout-title {
  margin-top: 1rem;
  color: var(--manual-text);
  font-weight: 900;
}

.manual-term {
  color: var(--manual-accent-text);
  font-weight: 900;
}

.defterm,
.manual-note-term {
  color: #000000;
  font-weight: 800;
}

[data-bs-theme="dark"] .defterm,
[data-bs-theme="dark"] .manual-note-term {
  color: #ffffff;
}

.manual-rule-summary {
  font-weight: 900;
}

.manual-tooltip-trigger,
.manual-term-link {
  text-decoration-style: dotted;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

.manual-term-link {
  color: inherit;
}

.manual-term-link:hover,
.manual-term-link:focus {
  color: inherit;
}

.manual-tooltip-trigger:focus,
.manual-term-link:focus {
  outline: 3px solid rgba(210, 38, 48, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.manual-tooltip {
  position: fixed;
  z-index: 1200;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid var(--manual-line);
  border-left: 5px solid var(--vex-red);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: var(--manual-surface);
  color: var(--manual-text);
  box-shadow: var(--manual-shadow);
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.42;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.manual-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.manual-tooltip strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--manual-accent-text);
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
}

.manual-caption {
  margin: -0.2rem 0 1.1rem;
  color: var(--manual-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
}

.manual-caption-title {
  color: var(--manual-text);
  font-weight: 900;
}

.manual-caption-description {
  color: var(--manual-muted);
}

.manual-note,
.manual-violation-note {
  border-left: 5px solid var(--vex-red);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-style:italic;
}

.manual-violation-note {
  border-left-color: #111111;
}

[data-bs-theme="dark"] .manual-violation-note {
  border-left-color: #ffffff;
}


.manual-grey-box {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #666666;
  color: #ffffff;
}

.manual-grey-box,
.manual-grey-box *,
[data-bs-theme="dark"] .manual-grey-box,
[data-bs-theme="dark"] .manual-grey-box * {
  color: #ffffff !important;
}






.manual-red-box {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: var(--vex-red);
  color: #ffffff;
}

aside.manual-red-box {
  margin-bottom: 1rem;
}

.manual-red-box > :last-child {
  margin-bottom: 0;
}

.manual-red-box,
.manual-red-box *,
[data-bs-theme="dark"] .manual-red-box,
[data-bs-theme="dark"] .manual-red-box * {
  color: #ffffff !important;
}

.manual-grey-box a,
.manual-red-box a {
  text-decoration-color: rgba(255, 255, 255, 0.88);
  text-decoration-thickness: 0.09em;
}

.manual-grey-box a:focus,
.manual-red-box a:focus {
  outline-color: rgba(255, 255, 255, 0.7);
}

.manual-white-text {
  color: #ffffff;
  font-weight:bold;
}

.manual-violation-text {
  font-weight: 800;
}

.manual-image {
  display: block;
  max-height: 680px;
  margin: 1rem auto;
  border: 1px solid var(--manual-line);
  border-radius: 8px;
  background: #ffffff;
}

.manual-image-zoomable {
  cursor: zoom-in;
}

.manual-image-zoomable:focus {
  outline: 3px solid rgba(210, 38, 48, 0.42);
  outline-offset: 4px;
}

.manual-image-modal .modal-dialog {
  max-width: min(1180px, calc(100vw - 2rem));
}

.manual-image-modal .modal-content {
  border: 1px solid var(--manual-line);
  background: var(--manual-surface);
  color: var(--manual-text);
}

.manual-image-modal .modal-body {
  padding: 1rem;
}

.manual-image-modal img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  margin: 0 auto;
  border: 1px solid var(--manual-line);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.manual-image-modal-caption {
  margin: 0.75rem 0 0;
  color: var(--manual-muted);
  font-size: 1.4rem;
  text-align: center;
}

.manual-image-row {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin: 1rem 0 1.4rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
}

.manual-image-row-item,
.manual-image-row-direct {
  flex: 1 0 min(280px, 78vw);
  min-width: 0;
  scroll-snap-align: start;
}

.manual-image-row-item .manual-image,
.manual-image-row-direct {
  width: 100%;
  max-height: 360px;
  margin: 0 auto;
  object-fit: contain;
}

.manual-table-wrap {
  margin: 1rem 0 1.4rem;
}

.manual-table {
  margin: 0;
  border-color: var(--manual-line);
  color: var(--manual-text);
  vertical-align: top;
}

.manual-table td,
.manual-table th {
  border-color: var(--manual-line);
  background: var(--manual-surface);
}

.manual-table.manual-table--red-header tr:first-child td,
.manual-table.manual-table--red-header tr:first-child th {
  background: var(--vex-red);
  color: #ffffff;
  font-weight: 900;
}

.search-hit {
  outline: 3px solid rgba(210, 38, 48, 0.35);
  outline-offset: 3px;
  background: rgba(210, 38, 48, 0.08);
}

mark {
  border-radius: 4px;
  padding: 0 0.12em;
  background: rgba(210, 38, 48, 0.22);
  color: inherit;
}

.manual-footer {
  max-width: none;
  margin: 1.25rem 0 0;
  color: var(--manual-muted);
  font-size: 0.88rem;
  text-align: center;
}

.offcanvas {
  background: var(--manual-surface);
  color: var(--manual-text);
}

.offcanvas .manual-toc {
  max-height: calc(100vh - 130px);
  overflow: auto;
}

@media (max-width: 991.98px) {
  :root {
    --manual-nav-height: 68px;
  }

  .manual-shell {
    display: block;
  }

  .manual-hero {
    grid-template-columns: 1fr;
  }

  .manual-hero-figure {
    display: none;
  }

  .manual-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-meta-strip div:nth-child(2) {
    border-right: 0;
  }

  .manual-meta-strip div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--manual-line);
  }
}

@media (max-width: 575.98px) {
  .manual-navbar .container-fluid {
    align-items: stretch;
  }

  .manual-brand-text span {
    display: none;
  }

  .manual-search {
    order: 3;
    width: 100%;
    margin-top: 0.75rem;
  }

  .manual-meta-strip {
    grid-template-columns: 1fr;
  }

  .manual-meta-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--manual-line);
  }

  .manual-meta-strip div:last-child {
    border-bottom: 0;
  }

  .manual-content {
    padding: 1rem;
  }
}

@media print {
  .manual-navbar,
  .manual-sidebar,
  .manual-search-panel,
  .manual-notice,
  .skip-link,
  .offcanvas {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .manual-shell,
  .manual-main,
  .manual-content {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .manual-content h2 {
    page-break-before: always;
  }
}
