:root {
  --navy: #07143d;
  --navy-soft: #1c2a59;
  --ink: #17213a;
  --muted: #5d6880;
  --subtle: #7c8699;
  --line: #dde2ea;
  --line-strong: #c8d0dd;
  --surface: #ffffff;
  --surface-muted: #f5f7fa;
  --surface-cool: #eef8fa;
  --cyan: #0787ad;
  --mint: #087b5d;
  --purple: #6540c9;
  --amber: #9a5b05;
  --danger: #a12e45;
  --header-height: 64px;
  --sidebar-width: 252px;
  --toc-width: 184px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--cyan);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: #055f7b;
}

:focus-visible {
  outline: 3px solid #006cff;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  transform: translateY(-140%);
}

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

.site-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(280px, 560px) auto;
  align-items: center;
  min-height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}

.brand:hover {
  color: var(--navy);
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 800;
}

.brand-copy span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
}

.search-shell:focus-within {
  border-color: #006cff;
  box-shadow: 0 0 0 2px rgba(0, 108, 255, 0.15);
  background: var(--surface);
}

.search-shell > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 12px;
  color: var(--muted);
}

.search-shell input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-shell input::placeholder {
  color: var(--subtle);
}

.search-shell kbd {
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.search-results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: min(480px, calc(100vh - 90px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(7, 20, 61, 0.16);
}

.search-results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.search-results a:hover,
.search-results a.is-active {
  background: var(--surface-cool);
}

.search-results a > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--cyan);
}

.search-result-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.search-result-copy strong,
.search-result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy strong {
  font-size: 14px;
}

.search-result-copy small {
  color: var(--muted);
  font-size: 12px;
}

.search-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-muted);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.menu-toggle,
.mobile-menu-header {
  display: none;
}

.documentation-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 760px) var(--toc-width);
  justify-content: center;
  column-gap: 42px;
  width: min(100%, 1320px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-height) + 34px) 24px 72px;
}

.site-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 22px);
  align-self: start;
  height: calc(100vh - var(--header-height) - 44px);
  overflow-y: auto;
  padding: 0 16px 18px 0;
  scrollbar-width: thin;
}

.navigation-section + .navigation-section {
  margin-top: 22px;
}

.navigation-section h2 {
  margin: 0 0 7px 10px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0;
}

.navigation-section > div {
  display: grid;
  gap: 2px;
}

.navigation-section a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: #46516a;
  font-size: 14px;
  font-weight: 590;
  line-height: 1.35;
  text-decoration: none;
}

.navigation-section a:hover {
  background: var(--surface-muted);
  color: var(--navy);
}

.navigation-section a.is-active {
  border-left-color: var(--cyan);
  background: var(--surface-cool);
  color: var(--navy);
  font-weight: 720;
}

.nav-state {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
}

.nav-state-available {
  background: var(--mint);
}

.nav-state-requires_homologation {
  background: var(--amber);
}

.nav-state-planned {
  background: var(--purple);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.4;
}

.sidebar-footer-mark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 10px 0 0 var(--mint);
  margin-right: 10px;
}

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

.loading-state {
  display: grid;
  gap: 14px;
  padding-top: 28px;
}

.loading-line {
  width: 100%;
  height: 14px;
  border-radius: 4px;
  background: var(--surface-muted);
}

.loading-line-short {
  width: 42%;
  height: 30px;
}

.article-content {
  width: 100%;
  max-width: 760px;
  min-width: 0;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  color: var(--navy);
  font-weight: 800;
  letter-spacing: 0;
  text-wrap: balance;
}

.article-content h1 {
  max-width: 700px;
  margin: 8px 0 16px;
  font-size: 36px;
  line-height: 1.16;
}

.article-content h2 {
  margin: 44px 0 12px;
  padding-top: 4px;
  font-size: 24px;
  line-height: 1.28;
}

.article-content h3 {
  margin: 30px 0 10px;
  font-size: 18px;
  line-height: 1.35;
}

.article-content p {
  margin: 0 0 18px;
  color: #35415a;
}

.article-content > h1 + p:not(.page-state),
.article-content > .page-state + h1 + p {
  color: #46536c;
  font-size: 18px;
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  margin: 0 0 22px;
  padding-left: 24px;
}

.article-content li {
  margin: 8px 0;
  padding-left: 4px;
}

.article-content li::marker {
  color: var(--cyan);
  font-weight: 750;
}

.article-content strong {
  color: var(--ink);
  font-weight: 760;
}

.article-content code {
  padding: 2px 5px;
  border: 1px solid #d9dce8;
  border-radius: 4px;
  background: #f5f3fb;
  color: #5835a9;
  font: 600 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.article-content a {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 650;
}

.article-content a svg {
  width: 13px;
  height: 13px;
  transform: translateY(2px);
}

.page-state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 27px;
  margin: 0 0 12px !important;
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.page-state::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.page-state-available {
  background: #edf9f4;
  color: #087255 !important;
}

.page-state-requires_homologation {
  background: #fff7e7;
  color: #8a4e00 !important;
}

.page-state-planned {
  background: #f3efff;
  color: #5d35b6 !important;
}

.editorial-placeholder {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  margin: 30px 0;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
}

.editorial-placeholder svg {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  color: var(--purple);
}

.editorial-placeholder p {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.pagbank-flow {
  margin: 34px 0 38px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pagbank-flow-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
}

.pagbank-flow-heading span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
}

.pagbank-flow-heading strong {
  color: var(--navy);
  font-size: 20px;
  line-height: 1.3;
}

.pagbank-flow-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(104px, auto));
  gap: 20px 0;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.pagbank-flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 104px;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid var(--line);
  border-top: 3px solid var(--flow-accent);
  border-radius: 6px;
  background: var(--flow-background);
}

.pagbank-flow-step:nth-child(1) {
  grid-area: 1 / 1;
}

.pagbank-flow-step:nth-child(2) {
  grid-area: 1 / 3;
}

.pagbank-flow-step:nth-child(3) {
  grid-area: 1 / 5;
}

.pagbank-flow-step:nth-child(4) {
  grid-area: 1 / 7;
}

.pagbank-flow-step:nth-child(5) {
  grid-area: 2 / 7;
}

.pagbank-flow-step:nth-child(6) {
  grid-area: 2 / 5;
}

.pagbank-flow-step:nth-child(7) {
  grid-area: 2 / 3;
}

.pagbank-flow-step:nth-child(8) {
  grid-area: 2 / 1;
}

.pagbank-flow-step::after {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.pagbank-flow-step:nth-child(-n + 3)::after {
  top: 50%;
  right: -24px;
  width: 24px;
  content: "\2192";
  transform: translateY(-50%);
}

.pagbank-flow-step:nth-child(4)::after {
  right: 50%;
  bottom: -20px;
  height: 20px;
  content: "\2193";
  transform: translateX(50%);
}

.pagbank-flow-step:nth-child(n + 5):nth-child(-n + 7)::after {
  top: 50%;
  left: -24px;
  width: 24px;
  content: "\2190";
  transform: translateY(-50%);
}

.pagbank-flow-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--flow-accent);
  color: #fff;
}

.pagbank-flow-icon svg {
  width: 18px;
  height: 18px;
}

.pagbank-flow-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pagbank-flow-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  text-transform: uppercase;
}

.pagbank-flow-copy strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.pagbank-flow-tone-mint {
  --flow-accent: #087b5d;
  --flow-background: #f1faf6;
}

.pagbank-flow-tone-cyan {
  --flow-accent: #087fa1;
  --flow-background: #f0f9fb;
}

.pagbank-flow-tone-purple {
  --flow-accent: #6540c9;
  --flow-background: #f6f3ff;
}

.pagbank-flow-tone-navy {
  --flow-accent: #1c2a59;
  --flow-background: #f3f5f9;
}

.pagbank-flow-tone-amber {
  --flow-accent: #9a5b05;
  --flow-background: #fff8ea;
}

.pagbank-flow figcaption {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.catalog-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 !important;
  list-style: none;
}

.catalog-link-list li {
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-link-list li:hover {
  border-color: #9acbd7;
  background: var(--surface-cool);
}

.page-toc {
  position: sticky;
  top: calc(var(--header-height) + 34px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 52px);
  overflow-y: auto;
  padding-left: 17px;
  border-left: 1px solid var(--line);
}

.page-toc > p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.page-toc nav {
  display: grid;
  gap: 3px;
}

.page-toc a {
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}

.page-toc a:hover,
.page-toc a[aria-current="location"] {
  color: var(--cyan);
}

.page-toc .toc-h3 {
  padding-left: 10px;
}

.fatal-error {
  padding: 18px;
  border: 1px solid #e5b6c0;
  border-radius: 8px;
  background: #fff4f6;
  color: var(--danger);
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 232px;
    --toc-width: 166px;
  }

  .documentation-layout {
    column-gap: 26px;
  }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 12px;
    padding: 0 16px;
  }

  .brand-copy span {
    display: none;
  }

  .search-shell kbd {
    display: none;
  }

  .menu-toggle,
  .mobile-menu-header {
    display: flex;
  }

  .menu-toggle {
    justify-self: end;
  }

  .documentation-layout {
    display: block;
    width: 100%;
    padding: calc(var(--header-height) + 28px) 22px 64px;
  }

  .site-sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(328px, calc(100vw - 48px));
    height: 100vh;
    padding: 0 18px 24px;
    border-right: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 16px 0 40px rgba(7, 20, 61, 0.18);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .site-sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-menu-header {
    position: sticky;
    z-index: 2;
    top: 0;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    margin: 0 -2px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-scrim {
    position: fixed;
    z-index: 65;
    inset: 0;
    background: rgba(7, 20, 61, 0.42);
  }

  body.menu-open {
    overflow: hidden;
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header {
    gap: 8px;
    padding: 0 12px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand-copy {
    display: none;
  }

  .search-shell {
    height: 38px;
  }

  .search-shell input {
    height: 36px;
    padding-right: 7px;
    font-size: 14px;
  }

  .search-shell > svg {
    margin-left: 9px;
  }

  .documentation-layout {
    padding: calc(var(--header-height) + 22px) 18px 54px;
  }

  .article-content h1 {
    font-size: 30px;
    line-height: 1.18;
  }

  .article-content h2 {
    margin-top: 38px;
    font-size: 22px;
  }

  .article-content > h1 + p:not(.page-state),
  .article-content > .page-state + h1 + p {
    font-size: 16px;
  }

  .catalog-link-list {
    grid-template-columns: 1fr;
  }

  .pagbank-flow {
    margin: 30px 0 34px;
    padding: 20px 0;
  }

  .pagbank-flow-list {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 22px;
  }

  .pagbank-flow-step:nth-child(n) {
    grid-area: auto / 1;
    min-height: 76px;
  }

  .pagbank-flow-list > .pagbank-flow-step:nth-child(n)::after {
    top: auto;
    right: 50%;
    bottom: -22px;
    left: auto;
    width: auto;
    height: 22px;
    content: "\2193";
    transform: translateX(50%);
  }

  .pagbank-flow-step:nth-child(8)::after {
    content: none;
  }

  .search-results {
    position: fixed;
    top: calc(var(--header-height) - 2px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - var(--header-height) - 14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
