:root {
  --brand: #016c74;
  --brand-dark: #005c63;
  --text: #223033;
  --text-soft: #66777a;
  --border: #dfe8e8;
  --page: #ffffff;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
}

.home-page-main {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.home-page-main img {
  display: block;
  width: min(360px, 72vw);
  height: auto;
}

body.home-page .announcement,
body.home-page .site-header,
body.home-page .document,
body.home-page .site-footer {
  display: none;
}

body.home-page .home-page-main {
  display: flex;
}

.announcement {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 9px 20px;
  color: #fff;
  background: var(--brand);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}

.announcement strong { font-weight: 600; }

.announcement-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  text-align: center;
}

.site-header {
  background: #fff;
  padding-top: 46px;
}

.header-inner,
.document,
.site-footer-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  width: min(860px, calc(100% - 48px));
  min-height: 108px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: end;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 16px;
}

.logo {
  display: block;
  width: 190px;
  max-width: 55vw;
  height: auto;
}

.header-caption {
  order: 2;
  margin-left: 0;
  color: var(--brand-dark);
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  padding-bottom: 0;
}

body:has(.document.pa-document) .header-caption {
  position: relative;
  top: 6px;
}

.pa-terms-caption {
  display: flex;
  flex-direction: column;
}

.logo {
  order: 1;
  align-self: end;
  transform: translateX(-8px);
}

.document {
  min-height: calc(100vh - 253px);
  padding: 54px 0 140px;
}

.document-body {
  max-width: 860px;
  margin: 0 auto;
  color: #454f51;
  font-size: 16px;
  line-height: 1.75;
}

.document.pa-document {
  position: relative;
  display: block;
}

.document.pa-document .document-body {
  max-width: 860px;
  margin: 0 auto;
}

.document.pa-document.pa-terms-document .pa-sidebar {
  display: none;
}

.document.pa-document.pa-privacy-document .pa-sidebar {
  display: none;
}

.pa-sidebar {
  display: none;
}

.document.pa-document .pa-sidebar {
  position: fixed;
  top: 180px;
  left: max(20px, calc((100vw - 860px) / 4 - 120px));
  display: block;
  width: 240px;
  margin: 0;
}

.pa-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa-sidebar a {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--brand-dark);
  background: #fff;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.pa-sidebar a:hover,
.pa-sidebar a:focus-visible,
.pa-sidebar a.is-active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.document-body h2 {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.3;
  font-weight: 800;
}

.document-body h2:not(:first-child) {
  margin-top: 42px;
}

.document-body p {
  margin: 0 0 18px;
}

.document-body ul {
  margin: -4px 0 18px;
  padding-left: 24px;
}

.document-body ol {
  margin: -4px 0 18px;
  padding-left: 28px;
}

.document-body li {
  padding-left: 4px;
  margin: 4px 0;
}

.document-body h3 {
  margin: 28px 0 10px;
  color: var(--brand-dark);
  font-size: 1rem;
  line-height: 1.4;
}

.api-intro {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  background: #f7fbfb;
}

.api-intro p { margin-bottom: 12px; }
.api-intro ul { margin: 0; }
.api-intro a { color: var(--brand-dark); font-weight: 700; }

.api-layout {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.api-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 28px 22px;
  background: #fff;
  border-right: 1px solid var(--border);
}

.api-sidebar-logo {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 38px;
}

.api-page-title {
  margin: 0 0 36px;
  padding-bottom: 14px;
  color: var(--brand-dark);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
  font-weight: 800;
  border-bottom: 2px solid var(--brand);
}

.api-sidebar-title {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.api-sidebar ul { margin: 0; padding: 0; list-style: none; }
.api-sidebar li { margin: 0; padding: 0; }
.api-sidebar a {
  display: block;
  white-space: nowrap;
  padding: 9px 10px;
  color: var(--text);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.api-sidebar a:hover,
.api-sidebar a:focus-visible {
  color: var(--brand-dark);
  background: #eef7f7;
}

.api-content {
  min-width: 0;
  padding: 48px 48px 120px;
}

.api-page-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 312px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 0;
  padding: 18px 48px;
  color: var(--text-soft);
  background: #fff;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.api-footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.api-footer-links a {
  color: inherit;
  text-decoration: none;
}

.api-footer-links a:hover,
.api-footer-links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.api-page .announcement,
.api-page .site-footer { display: none; }

.api-page .document {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.api-page .document-body {
  width: 100%;
  max-width: none;
}

.api-specification {
  scroll-margin-top: 70px;
  padding-top: 12px;
}

.api-specification + .api-specification {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.api-specification-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.api-specification-heading h2 { margin-bottom: 6px; }
.api-specification-heading p { margin-bottom: 18px; }

.api-index {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-weight: 800;
}

.document-lead {
  font-size: 1.1rem;
}

.document-body figure {
  margin: 24px 0;
  text-align: center;
}

.document-body figure img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.document-body figure img.screenshot-bordered {
  border: 1px solid var(--border);
}

.document-body .guide-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 42px;
  margin-bottom: 14px;
}

.document-body .guide-heading:first-of-type {
  margin-top: 0;
}

.document-body .guide-heading h2 {
  margin: 0 !important;
}

.document-body .guide-marker {
  display: block;
  width: 30px;
  height: auto;
  flex: 0 0 30px;
}

.document-note,
.document-warning {
  padding: 16px 20px;
  border-left: 4px solid var(--brand);
  background: #f7fbfb;
}

.document-warning {
  margin: 24px 0;
  color: var(--brand-dark);
  font-weight: 600;
}

.document-source {
  margin-top: 40px !important;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 14px;
  color: #fff;
  background: #25383b;
  border-radius: 4px;
}

.api-endpoint code { white-space: nowrap; }
.api-method { color: #78e1c1; font-weight: 800; }

.api-headers {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.api-headers div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 14px;
}

.api-headers div + div { border-top: 1px solid var(--border); }
.api-headers dt { font-weight: 700; }
.api-headers dd { margin: 0; overflow-wrap: anywhere; }

.api-code {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  padding: 18px;
  color: #e7f4f2;
  background: #25383b;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.55;
}

.api-code code { white-space: pre; }

.api-notes-content p { margin-bottom: 12px; }
.api-notes { list-style-type: disc; margin-left: 0; padding-left: 24px; }
.api-notes-content > .api-notes { margin-left: 3ch; }
.api-notes.api-subnotes { list-style-type: disc; margin-top: -4px; }
.api-notes:not(.api-subnotes) + .api-notes:not(.api-subnotes) { margin-top: 14px; }

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  color: #fff;
  background: var(--brand);
}

.site-footer-inner {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 10px 0;
  font-size: 12px;
  text-align: center;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.footer-contact:hover,
.footer-contact:focus-visible {
  text-decoration: underline;
}

.footer-contact svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 1000px) {
  .document.pa-document .pa-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 28px;
  }
}

@media (max-width: 700px) {
  .header-inner,
  .document,
  .site-footer-inner {
    width: min(100% - 32px, 1120px);
  }

  .header-inner {
    min-height: 88px;
    padding-top: 18px;
    gap: 16px;
    grid-template-columns: 156px minmax(0, 1fr);
  }

  .site-header { padding-top: 58px; }

  .logo { width: 156px; }
  .header-caption {
    max-width: calc(100% - 172px);
    font-size: 14px;
  }

  .announcement { font-size: 15px; }

  .site-footer-inner {
    gap: 14px;
    flex-wrap: wrap;
  }

  .footer-contact { font-size: 12px; }

  .document {
    min-height: calc(100vh - 233px);
    padding: 36px 0 140px;
  }

  .document.pa-document .pa-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 28px;
  }

  .api-headers div { grid-template-columns: 1fr; gap: 2px; }
  .api-endpoint { align-items: flex-start; flex-direction: column; gap: 4px; }
  .api-layout { display: block; }
  .api-sidebar { position: static; min-height: auto; margin-bottom: 0; padding: 20px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .api-sidebar-logo { width: 150px; margin: 0 0 20px; }
  .api-page-title { margin-bottom: 28px; }
  .api-content { padding: 28px 16px 100px; }
  .api-page-footer { left: 0; gap: 12px; padding: 16px; }
  .api-footer-links { gap: 8px 16px; }

}
