/* ============================================================
   docs
   ============================================================ */

.docs-page { background: var(--paper); }
.docs-header {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 245, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.docs-header-inner {
  width: min(1440px, calc(100% - 48px));
  min-height: 64px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 270px minmax(240px, 1fr) 270px;
  align-items: center;
  gap: 24px;
}
.docs-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.docs-brand .brand img { width: 34px; height: 34px; border-radius: 10px; }
.docs-brand .brand-name strong { font-size: 15px; }
.docs-brand .brand-name span { display: none; }
.docs-brand .brand .brand-logo { width: auto; height: 30px; border-radius: 0; }
.docs-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.docs-search { position: relative; width: min(100%, 420px); justify-self: center; }
.docs-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.docs-search input {
  width: 100%;
  height: 40px;
  padding: 0 54px 0 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s var(--ease-state), box-shadow 0.2s var(--ease-state), background 0.2s var(--ease-state);
}
.docs-search input::placeholder { color: var(--muted-2); }
.docs-search input:focus { border-color: var(--green); background: var(--white); box-shadow: 0 0 0 3px rgba(56, 217, 150, 0.16); }
.docs-search kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.2;
}
.search-results {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  max-height: 360px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 30px 60px -30px rgba(10, 46, 31, 0.35);
  z-index: 80;
}
.search-results[hidden] { display: none; }
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
.search-result:hover, .search-result.is-active { background: var(--mint-wash); color: var(--ink); }
.search-result b { color: var(--green); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: 0.08em; }
.search-empty { padding: 14px 12px; color: var(--muted-2); font-size: 12px; }
.docs-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.docs-header-actions .btn { min-height: 36px; padding-inline: 14px; font-size: 12px; }
.docs-menu-btn, .docs-search-open { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); align-items: center; justify-content: center; }

.docs-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 204px;
  gap: 40px;
  align-items: start;
}
.docs-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.docs-drawer-head { display: none; }
.docs-side-group + .docs-side-group { margin-top: 28px; }
.docs-side-group h3 {
  margin: 0 0 8px 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.docs-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  transition: color 0.2s var(--ease-state), background 0.2s var(--ease-state), border-color 0.2s var(--ease-state);
}
.docs-side-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.docs-side-link.is-active { border-left-color: var(--green); background: var(--mint-wash); color: var(--green-deep); font-weight: 600; }
.docs-side-link em { color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; font-style: normal; letter-spacing: 0.08em; }
.docs-side-note {
  margin: 26px 10px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}
.docs-side-note a { color: var(--green); }

.docs-main {
  min-width: 0;
  padding: 44px 46px 52px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
}
.docs-hero { padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.docs-hero h1 {
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(34px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}
.docs-hero > p { max-width: 680px; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.docs-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.docs-hero-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.docs-copy-url {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #c9e4d4;
  border-radius: 999px;
  background: var(--mint-wash);
  color: var(--green-deep);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.01em;
}
.docs-copy-url:hover { background: var(--mint-soft); }
.docs-copy-url svg { color: var(--green); }

.docs-content { padding-top: 6px; }
.api-section { scroll-margin-top: 94px; }
.api-section + .api-section { margin-top: 54px; padding-top: 44px; border-top: 1px solid var(--line); }
.api-section-title {
  position: relative;
  margin: 40px 0 14px;
  color: var(--ink);
  font-size: clamp(25px, 2.5vw, 31px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.035em;
  scroll-margin-top: 94px;
}
.api-section > .api-section-title:first-child { margin-top: 0; }
.api-section-title .anchor, .api-sub-title .anchor,
.api-section h3 .anchor {
  margin-left: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.55em;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.2s var(--ease-state), color 0.2s var(--ease-state);
}
.api-section-title:hover .anchor, .api-section h3:hover .anchor { opacity: 1; }
.api-section-title .anchor:hover, .api-section h3 .anchor:hover { color: var(--green); }
.api-section h3 {
  margin: 40px 0 14px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  scroll-margin-top: 94px;
}
.api-desc { color: var(--muted); font-size: 14.5px; line-height: 1.85; }
.api-desc + .api-desc { margin-top: 12px; }
.api-card-body ul { display: grid; gap: 7px; margin-top: 14px; }
.api-card-body li { position: relative; padding-left: 16px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.api-card-body li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}
.api-card-body li strong { color: var(--ink-2); font-weight: 600; }
.api-desc strong { color: var(--ink-2); font-weight: 600; }
.api-desc code, .docs-content p code, .auth-note code {
  padding: 2px 5px;
  border: 1px solid #d7ebdf;
  border-radius: 5px;
  background: var(--mint-wash);
  color: var(--green-deep);
  font-size: 0.88em;
}
.api-card {
  margin: 18px 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 12px 30px -28px rgba(10, 46, 31, 0.28);
}
.api-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
  background: #f8fbf8;
}
.api-method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.api-method-GET { background: var(--mint-soft); color: var(--green-deep); }
.api-method-POST { background: var(--green-dark); color: var(--mint-2); }
.api-path { color: var(--ink-2); font-size: 12.5px; }
.api-card-body { padding: 18px 20px 20px; }
.api-params-title {
  margin: 18px 0 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.api-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.6;
}
.api-params-table th {
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: #f6faf7;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.api-params-table td { padding: 10px 11px; border: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.api-params-table tr:hover td { background: #fbfdfb; }
.api-param-name { color: var(--green-deep); font-family: var(--font-mono); font-size: 11.5px; }
.api-param-type { color: var(--muted-2); font-family: var(--font-mono); font-size: 10.5px; }
.api-param-required, .api-param-optional {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
}
.api-param-required { background: var(--mint-soft); color: var(--green-deep); }
.api-param-optional { background: var(--paper-2); color: var(--muted-2); }

.doc-code {
  margin: 16px 0 4px;
  overflow: hidden;
  border: 1px solid rgba(56, 217, 150, 0.14);
  border-radius: 13px;
  background: var(--green-dark);
}
.doc-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}
.doc-code-tabs { display: flex; gap: 3px; }
.doc-code-tab {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #7f9b88;
  font-family: var(--font-mono);
  font-size: 9.5px;
  transition: color 0.2s var(--ease-state), background 0.2s var(--ease-state);
}
.doc-code-tab:hover { color: var(--white); }
.doc-code-tab.is-active { border-color: rgba(56, 217, 150, 0.18); background: rgba(56, 217, 150, 0.12); color: var(--mint-2); }
.doc-code-label { color: #7f9b88; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; }
.doc-code-copy {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: transparent;
  color: #8ba294;
  font-family: var(--font-mono);
  font-size: 9px;
}
.doc-code-copy:hover { border-color: rgba(255, 255, 255, 0.26); color: var(--white); }
.doc-code-body { overflow: hidden; }
.doc-code-pane {
  display: none;
  margin: 0;
  padding: 17px 19px 19px;
  overflow: auto;
  color: #d9e7dc;
  font-size: 12px;
  line-height: 1.75;
  tab-size: 2;
}
.doc-code-pane.is-active { display: block; }
.doc-code-pane code { font-family: var(--font-mono); font-size: inherit; background: none; padding: 0; color: inherit; white-space: pre; }
.doc-code-pane .token.keyword, .doc-code-pane .token.boolean, .doc-code-pane .token.important { color: #8be3b7; }
.doc-code-pane .token.string, .doc-code-pane .token.char, .doc-code-pane .token.attr-value { color: #c7e8a9; }
.doc-code-pane .token.comment, .doc-code-pane .token.prolog, .doc-code-pane .token.doctype { color: #6a8674; }
.doc-code-pane .token.function, .doc-code-pane .token.class-name { color: #7fe7b8; }
.doc-code-pane .token.number, .doc-code-pane .token.operator, .doc-code-pane .token.punctuation { color: #a8c9b6; }
.doc-code-pane .token.property, .doc-code-pane .token.attr-name { color: #9ee6c1; }

.docs-content details {
  margin: 10px 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfb;
  scroll-margin-top: 94px;
}
.docs-content details[open] { border-color: #c9e4d4; background: var(--mint-wash); }
.docs-content summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
}
.docs-content summary::-webkit-details-marker { display: none; }
.docs-content summary::after { content: "+"; color: var(--green); font-family: var(--font-mono); font-size: 15px; font-weight: 400; }
.docs-content details[open] summary::after { content: "−"; }
.docs-content details p { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.8; }

.docs-content a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.docs-content a:hover { color: var(--green-deep); }

.docs-foot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.7;
}
.docs-foot svg { flex: none; margin-top: 2px; color: var(--green); }

.docs-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.docs-toc > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.docs-toc nav { display: flex; flex-direction: column; gap: 2px; }
.docs-toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
  transition: color 0.2s var(--ease-state), padding 0.2s var(--ease-state);
}
.docs-toc a.is-sub { padding-left: 10px; color: #93a397; font-size: 10.5px; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.is-active { color: var(--green); font-weight: 600; }

.docs-footer {
  width: min(1440px, calc(100% - 48px));
  margin: 52px auto 0;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted-2);
  font-size: 10.5px;
}
.docs-footer .legal { display: flex; flex-wrap: wrap; gap: 12px; }
.docs-footer a:hover { color: var(--green); }

.docs-backdrop { display: none; }

/* mobile search */
.docs-mobile-search { display: none; }

@media (max-width: 1200px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
  .docs-header-inner { grid-template-columns: 240px minmax(200px, 1fr) 220px; }
}
@media (max-width: 960px) {
  .docs-header-inner { grid-template-columns: 1fr auto; min-height: 58px; gap: 12px; }
  .docs-search { display: none; }
  .docs-header-actions .btn { display: none; }
  .docs-menu-btn, .docs-search-open { display: inline-flex; }
  .docs-shell { display: block; width: calc(100% - 32px); margin-top: 18px; }
  .docs-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(310px, 86vw);
    max-height: none;
    padding: 82px 18px 28px;
    border-right: 1px solid var(--line);
    background: var(--paper);
    transform: translateX(-102%);
    transition: transform 0.35s var(--ease-out);
    overflow: auto;
  }
  .docs-sidebar.is-open { transform: none; }
  .docs-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 22px;
    left: 20px;
    right: 16px;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .docs-drawer-close {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--green);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
  }
  .docs-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(10, 46, 31, 0.32);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-state);
  }
  .docs-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .docs-main { padding: 30px 26px 40px; border-radius: 18px; }
  .docs-hero h1 { font-size: 34px; }
  .docs-mobile-search {
    display: block;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    z-index: 78;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    transform: translateY(calc(-100% - 62px));
    transition: transform 0.28s var(--ease-state);
  }
  .docs-mobile-search.is-open { transform: none; }
  .docs-mobile-search .docs-search { display: block; width: 100%; }
}
@media (max-width: 620px) {
  .docs-header-inner { width: calc(100% - 28px); }
  .docs-brand .docs-badge { display: none; }
  .docs-main { padding: 24px 16px 32px; border: 0; border-radius: 0; background: transparent; }
  .docs-hero { padding: 10px 2px 26px; }
  .docs-hero h1 { font-size: 30px; }
  .docs-hero > p { font-size: 13.5px; }
  .docs-hero-meta { gap: 6px; }
  .docs-copy-url { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .api-section + .api-section { margin-top: 40px; padding-top: 34px; }
  .api-section-title { font-size: 25px; }
  .api-section h3 { font-size: 19px; margin-top: 32px; }
  .api-desc { font-size: 13.5px; }
  .api-card-body { padding: 15px 13px 16px; overflow-x: auto; }
  .api-params-table { min-width: 0; font-size: 10.5px; table-layout: auto; }
  .api-params-table th, .api-params-table td { padding: 8px 6px; word-break: break-word; }
  .api-params-table--params th:nth-child(2),
  .api-params-table--params td:nth-child(2) { display: none; }
  .api-params-table--params th:nth-child(1),
  .api-params-table--params td:nth-child(1) { width: 44%; }
  .doc-code { border-radius: 10px; }
  .doc-code-pane { font-size: 11px; padding: 14px 13px 16px; }
  .doc-code-tab { font-size: 9px; padding-inline: 7px; }
  .docs-footer { width: calc(100% - 32px); flex-direction: column; align-items: flex-start; }
}
