.document-page {
  --document-muted: #465e53;
  --document-border: #dce8df;
  --document-green: #16634d;
  background: #f8faf7;
  color: var(--ink);
}

.document-page .document-layout {
  width: min(1120px, calc(100% - clamp(36px, 10vw, 144px)));
}

.document-hero {
  --ink: #f3f8f3;
  --muted: #b4ccbf;
  --green: var(--accent);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 0;
  background:
    radial-gradient(ellipse at 82% 60%, #245746 0%, transparent 55%),
    linear-gradient(116deg, #0e231d 23%, #123329 100%);
  color: var(--ink);
}

.document-hero > .wrap {
  position: relative;
  display: grid;
  padding-block: 30px clamp(48px, 6vw, 78px);
}

.document-hero .breadcrumbs {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
}

.document-hero .breadcrumbs a:hover {
  text-decoration: underline;
}

.document-hero-copy {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin-inline: auto;
}

.document-category {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  color: #a4f2d9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.document-category::before {
  content: none;
}

.document-category .ui-icon {
  width: 1rem;
  height: 1rem;
}

.document-hero h1 {
  max-width: 65%;
  margin: 0.12em 0 0.28em;
  font-size: clamp(2.8rem, 7vw, 5.75rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.99;
}

.document-hero .date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.42rem 0.8rem;
  border: 1px solid #b0f4db42;
  border-radius: 999px;
  background: #15392f;
  color: #c5ddd1;
  font-size: 0.82rem;
}

.document-hero time {
  color: var(--ink);
  font-weight: 650;
}

.document-art {
  position: absolute;
  inset-inline-end: -2%;
  inset-block-start: 52%;
  width: min(47%, 525px);
  transform: translateY(-50%);
  pointer-events: none;
}

.document-art > svg {
  display: block;
  width: 100%;
}

.document-art-mark {
  position: absolute;
  inset-inline-start: 53.6%;
  inset-block-start: 50.3%;
  display: grid;
  place-items: center;
  width: clamp(58px, 8vw, 112px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #8ce9cc8c;
  border-radius: 29%;
  background: linear-gradient(145deg, #34735c, #133d31 76%);
  box-shadow: 0 18px 44px #071a1766, 0 0 45px #53e0be26, inset 0 1px #c9f9e853;
}

.document-art-mark img {
  width: 49%;
  height: auto;
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(206px, 252px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 74px);
  align-items: start;
  padding-block: clamp(34px, 5vw, 68px) clamp(64px, 9vw, 116px);
}

.document-rail {
  position: sticky;
  inset-block-start: 24px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--document-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 28px #17382b0a;
}

.document-contents summary,
.document-contents-label {
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.document-contents summary {
  display: none;
  list-style: none;
}

.document-contents summary::-webkit-details-marker {
  display: none;
}

.document-contents-label {
  display: flex;
  padding: 16px 10px 13px;
  border-bottom: 1px solid var(--document-border);
}

.document-contents nav {
  padding: 0 9px 9px;
}

.document-contents :is(.ui-icon, .document-chevron) {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--document-green);
}

.document-contents ol,
.document-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-contents ol {
  padding-top: 7px;
}

.document-contents li + li {
  margin-top: 2px;
}

.document-contents a {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  align-items: baseline;
  gap: 0.6rem;
  padding: 8px 8px 8px 10px;
  border-inline-start: 2px solid transparent;
  border-radius: 7px;
  color: var(--document-muted);
  font-size: 0.85rem;
  font-weight: 550;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.document-contents a span {
  color: var(--document-green);
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

.document-contents a:hover,
.document-contents a[aria-current="location"] {
  background: #eaf5ee;
  color: #164b3c;
}

.document-contents a[aria-current="location"] {
  border-inline-start-color: #268165;
  font-weight: 700;
}

.document-contents a:focus-visible,
.document-contents summary:focus-visible {
  outline-offset: -3px;
}

.document-reading {
  min-width: 0;
}

.document-prose {
  max-width: 68ch;
  color: var(--document-muted);
  font-size: clamp(1rem, 0.97rem + 0.25vw, 1.12rem);
  line-height: 1.76;
  overflow-wrap: anywhere;
}

.document-prose p,
.document-prose :is(ul, ol) {
  margin: 0 0 1em;
}

.document-prose :is(ul, ol) {
  padding-inline-start: 1.45em;
}

.document-prose li + li {
  margin-top: 0.55em;
}

.document-prose strong {
  color: var(--ink);
}

.document-prose a,
.document-related a {
  color: var(--document-green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.document-prose a:hover,
.document-related a:hover {
  color: #123e32;
  text-decoration-thickness: 2px;
}

.document-intro,
.document-callout {
  padding: clamp(16px, 2.8vw, 28px);
  border: 1px solid var(--document-border);
  border-inline-start: 3px solid #319677;
  border-radius: 4px 14px 14px 4px;
  background: #edf6ef;
  color: #2d4b40;
}

.document-intro > :last-child,
.document-callout > :last-child,
.document-section > :last-child {
  margin-bottom: 0;
}

.document-section {
  padding-block: clamp(23px, 3vw, 37px);
  border-bottom: 1px solid var(--document-border);
}

.document-section-heading {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.7em;
}

.document-section-number {
  position: absolute;
  inset-inline-end: calc(100% + 0.8rem);
  inset-block-start: 0.2em;
  color: var(--document-green);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.document-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.38rem, 1.02rem + 0.9vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  scroll-margin-top: 26px;
}

.document-section h2:focus-visible {
  outline: 2px solid var(--document-green);
  outline-offset: 4px;
}

.document-section h2:target {
  color: var(--document-green);
}

.document-section .document-permalink {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-start;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
}

.document-section .document-permalink:hover,
.document-section .document-permalink:focus-visible {
  background: #eaf5ee;
}

.document-related {
  max-width: 68ch;
  margin-top: 30px;
  padding: 18px 22px;
  border: 1px solid var(--document-border);
  border-radius: 14px;
  background: var(--surface);
}

.document-related h2 {
  margin: 0 0 4px;
  color: var(--document-muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.document-related a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
}

.document-related .ui-icon {
  width: 1rem;
  height: 1rem;
}

@media (width < 1200px) {
  body:has(.document-page) .contact-launcher {
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: none;
  }
}

@media (width < 900px) {
  .document-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    max-width: 692px;
  }

  .document-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .document-contents summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 15px;
  }

  .document-contents[open] .document-chevron {
    transform: rotate(180deg);
  }

  .document-contents nav {
    padding-inline: 12px;
  }

  .document-contents ol {
    border-top: 1px solid var(--document-border);
  }

  .document-contents a {
    min-height: 40px;
  }

  .document-contents-label {
    display: none;
  }

  .document-section-number {
    position: static;
    flex: none;
  }
}

@media (max-width: 600px) {
  .document-hero > .wrap {
    padding-bottom: 33px;
  }

  .document-hero h1 {
    max-width: 10ch;
    font-size: clamp(2.8rem, 10.5vw, 3.8rem);
  }

  .document-art {
    inset-inline-end: -34%;
    inset-block-start: 47%;
    width: 87%;
    opacity: 0.58;
  }

  .document-art-mark {
    display: none;
  }
}

.document-prose table {
  width: 100%;
  margin: 1rem 0 1.25rem;
  table-layout: fixed;
  border: 1px solid var(--document-border);
  border-spacing: 0;
  border-radius: 12px;
  background: var(--surface);
  font-size: clamp(0.82rem, 0.78rem + 0.25vw, 0.98rem);
  line-height: 1.5;
  text-align: left;
}

.document-prose caption {
  margin-bottom: 0.5rem;
  color: var(--document-muted);
  font-size: 0.9rem;
  text-align: left;
}

.document-prose :is(th, td) {
  padding: clamp(0.43rem, 1.2vw, 0.8rem);
  border-bottom: 1px solid var(--document-border);
  vertical-align: top;
}

.document-prose thead th {
  color: var(--ink);
}

.document-prose thead th:first-child {
  width: 32%;
}

.document-prose thead th:last-child {
  width: 24%;
  white-space: nowrap;
}

.document-prose th[scope="rowgroup"] {
  background: #edf6ef;
  color: var(--document-green);
}

.document-prose tr:last-child > :is(th, td) {
  border-bottom: 0;
}

.document-prose :is(thead, tbody):not(:last-child) tr:last-child > :is(th, td) {
  border-bottom: 1px solid var(--document-border);
}

.document-prose td + td {
  color: var(--ink);
}

.document-prose th code {
  color: var(--ink);
  font-size: 0.88em;
  font-weight: 600;
}

.document-preferences {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--document-green);
  border-radius: 8px;
  background: #edf6ef;
  color: var(--document-green);
  font-weight: 650;
}

.document-preferences:hover {
  background: #dcefe3;
}

@media (max-width: 480px) {
  .document-prose thead th:first-child {
    width: 36%;
  }

  .document-prose thead th:last-child {
    width: 25%;
  }
}

.document-prose .document-provider-table thead th:first-child {
  width: 28%;
}

.document-prose .document-provider-table thead th:last-child {
  width: 32%;
}

@media (max-width: 480px) {
  .document-prose .document-provider-table thead th:first-child {
    width: 31%;
  }
}
