@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --header-height: 66px;
  --sidebar-width: 268px;
  --page-width: 980px;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #d97706;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --code-bg: #0f172a;
  --code-text: #dbeafe;
  --radius: 10px;
  --shadow: 0 18px 55px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 18px); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.docs-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-height);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-brand-row,
.header-actions,
.docs-brand,
.health-indicator,
.api-health-card,
.footer-health,
.sidebar-label-row,
.endpoint-toolbar,
.section-heading,
.section-heading-row,
.response-tools,
.request-actions {
  display: flex;
  align-items: center;
}

.header-brand-row { gap: 10px; }
.docs-brand {
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--text);
  border-radius: 9px;
  font: 600 11px/1 "JetBrains Mono", monospace;
}
.docs-brand > span:last-child { display: grid; line-height: 1.15; }
.docs-brand strong { font-size: 14px; }
.docs-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mobile-menu-button {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.header-actions { min-width: 0; gap: 9px; }
.header-search {
  width: min(340px, 30vw);
  position: relative;
  display: flex;
  align-items: center;
}
.header-search > span {
  position: absolute;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}
.header-search input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 37px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.header-search input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.header-link {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 7px;
  text-decoration: none;
  font-weight: 500;
}
.header-link:hover { color: var(--text); background: var(--surface); }
.health-indicator,
.footer-health {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.health-indicator {
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.health-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.health-dot.is-up { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.health-dot.is-down { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.health-dot.is-checking { background: var(--amber); animation: health-pulse 1.2s ease-in-out infinite; }
@keyframes health-pulse { 50% { opacity: .35; } }

.docs-shell { min-height: 100vh; padding-top: var(--header-height); }
.docs-sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-width);
  padding: 24px 17px 40px;
  overflow-y: auto;
  background: #fbfcfe;
  border-right: 1px solid var(--border);
}
.sidebar-group + .sidebar-group { margin-top: 28px; }
.sidebar-label-row { justify-content: space-between; gap: 10px; }
.sidebar-label,
.sidebar-label-row p {
  margin: 0 9px 8px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.sidebar-label-row span { margin-right: 9px; color: #94a3b8; font-size: 10px; }
.sidebar-link,
.endpoint-sidebar-links a {
  min-height: 34px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  color: #475569;
  border-radius: 7px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.sidebar-link:hover,
.endpoint-sidebar-links a:hover { color: var(--text); background: var(--surface-2); }
.sidebar-link.active,
.endpoint-sidebar-links a.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 600;
}
.sidebar-loading { padding: 7px 9px; display: block; color: #94a3b8; font-size: 11px; }
.sidebar-backdrop { position: fixed; inset: var(--header-height) 0 0; z-index: 35; background: rgba(15,23,42,.45); }

.docs-main {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}
.docs-section {
  width: min(var(--page-width), calc(100% - 64px));
  margin-inline: auto;
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.overview-section { padding-top: 54px; }
.section-breadcrumb { margin-bottom: 28px; color: #94a3b8; font-size: 11px; }
.overview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.version-badge {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  font: 600 10px/1.3 "JetBrains Mono", monospace;
}
.overview-heading h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1;
  letter-spacing: -2.7px;
}
.overview-heading p { max-width: 670px; margin: 17px 0 0; color: var(--muted); font-size: 17px; }
.overview-heading .byline { margin-top: 8px; font-size: 12px; }
.api-health-card {
  min-width: 150px;
  padding: 12px 14px;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.api-health-card > span:last-child { display: grid; }
.api-health-card strong { font-size: 12px; }
.api-health-card small { color: var(--muted); font-size: 10px; }
.api-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.api-links a {
  padding: 6px 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 6px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.info-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 13px;
}
.info-card {
  padding: 19px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.info-label { display: block; margin-bottom: 8px; color: #94a3b8; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.info-card strong { font-size: 14px; }
.info-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.section-heading { align-items: flex-start; gap: 16px; }
.section-number {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 7px;
  font: 600 10px/1 "JetBrains Mono", monospace;
}
.section-heading h2 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -.8px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); }
.base-url-box {
  margin-top: 26px;
  padding: 10px 10px 10px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.base-url-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #334155;
  font: 500 12px/1.5 "JetBrains Mono", monospace;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.code-example,
.code-preview,
.response-data {
  color: var(--code-text);
  background: var(--code-bg);
  border-radius: 9px;
  font-family: "JetBrains Mono", monospace;
}
.code-example { margin: 14px 0 0; padding: 17px; overflow-x: auto; font-size: 11px; line-height: 1.7; }
.token-comment { color: #64748b; }
.token-string { color: #86efac; }
.callout {
  margin-top: 24px;
  padding: 16px 18px;
  color: #334155;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}
.callout strong { font-size: 13px; }
.callout p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.status-table-wrap { margin-top: 24px; overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; }
.status-table { width: 100%; border-collapse: collapse; text-align: left; }
.status-table th,
.status-table td { padding: 13px 15px; border-bottom: 1px solid var(--border); font-size: 12px; }
.status-table th { color: #475569; background: var(--surface); font-size: 10px; text-transform: uppercase; }
.status-table tr:last-child td { border-bottom: 0; }
.status-table td:last-child { color: var(--muted); }
.status-table code { font-family: "JetBrains Mono", monospace; font-weight: 600; }

.endpoint-heading { margin-bottom: 20px; }
.endpoint-toolbar {
  padding: 11px 13px;
  justify-content: flex-end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.endpoint-toolbar span { color: var(--muted); font-size: 11px; }
.endpoint-toolbar span:first-child { margin-right: auto; color: #334155; font-weight: 600; }
.api-status { margin: 13px 2px 0; color: #94a3b8; font-size: 11px; }
#api-content { margin-top: 22px; }
.endpoint-category {
  margin-bottom: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.category-heading {
  min-height: 49px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbfdff;
  border-bottom: 1px solid var(--border);
}
.category-heading h2 { margin: 0; font-size: 14px; }
.category-heading span { color: #94a3b8; font-size: 10px; }
.endpoint-grid { padding: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.endpoint-card-main {
  min-height: 164px;
  height: 100%;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.endpoint-card-main:hover { border-color: #b8c3d1; box-shadow: 0 8px 22px rgba(15,23,42,.06); }
.endpoint-card-copy { display: flex; align-items: flex-start; gap: 10px; }
.endpoint-card-text { min-width: 0; }
.endpoint-card h3 { margin: 0 0 5px; font-size: 13px; }
.endpoint-card p { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.endpoint-card code {
  display: block;
  overflow: hidden;
  color: #475569;
  font: 500 10px/1.5 "JetBrains Mono", monospace;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.endpoint-card-actions { display: flex; justify-content: flex-end; gap: 7px; }
.method-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 5px;
  font: 700 9px/1.4 "JetBrains Mono", monospace;
}
.method-post { color: #047857; background: #d1fae5; }
.method-put,
.method-patch { color: #a16207; background: #fef3c7; }
.method-delete { color: #b91c1c; background: #fee2e2; }

.primary-button,
.secondary-button,
.copy-button,
.get-api-btn,
.retro-button,
.tkm-button {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 1px 1px rgba(15,23,42,.03);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.primary-button,
.get-api-btn,
.tkm-button,
#submit-api { color: #fff; background: var(--primary); border-color: var(--primary); }
.primary-button:hover,
.get-api-btn:hover,
.tkm-button:hover,
#submit-api:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.secondary-button:hover,
.copy-button:hover,
.retro-button:hover { background: var(--surface); border-color: #aeb9c8; }
.endpoint-card-actions button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.error-panel { padding: 20px; color: #991b1b; background: var(--red-soft); border: 1px solid #fecaca; border-radius: 8px; }

.changelog-list { margin-top: 24px; display: grid; gap: 9px; }
.changelog-entry { padding: 0 15px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.changelog-summary { padding: 14px 0; cursor: pointer; font-size: 12px; font-weight: 600; }
.changelog-list-items { margin: 0 0 15px 18px; padding: 0; color: var(--muted); font-size: 11px; }
.changelog-list-items li + li { margin-top: 5px; }
.support-links { margin-top: 24px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.support-links a {
  padding: 16px;
  display: grid;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
}
.support-links a:hover { border-color: var(--border-strong); }
.support-links strong { font-size: 12px; }
.support-links span { color: var(--muted); font-size: 10px; }
.docs-footer {
  width: min(var(--page-width), calc(100% - 64px));
  margin-inline: auto;
  padding: 28px 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #94a3b8;
  font-size: 10px;
}
.docs-footer p { margin: 0; }

#api-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  opacity: 0;
  transition: opacity .14s ease;
}
#api-modal.opacity-100 { opacity: 1; }
.tkm-modal { position: fixed; inset: 0; background: #020617; opacity: 0; transition: opacity .14s ease; }
.tkm-modal.opacity-50 { opacity: .66; }
.tkm-modal-content {
  position: relative;
  z-index: 1;
  width: min(850px,100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .14s ease, transform .14s ease;
}
.tkm-modal-content.opacity-100 { opacity: 1; transform: none; }
.modal-content-inner,
.response-panel-inner { padding: 23px; }
.modal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-title-copy { min-width: 0; display: flex; align-items: flex-start; gap: 11px; }
.modal-title-copy > div { min-width: 0; }
.modal-title-row h2 { margin: 0; font-size: 19px; }
.modal-title-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.modal-close {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.endpoint-meta-grid { margin-top: 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 9px; }
.endpoint-meta { min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.endpoint-meta span,
.endpoint-meta strong,
.endpoint-meta code { display: block; }
.endpoint-meta span { margin-bottom: 3px; color: #94a3b8; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.endpoint-meta strong,
.endpoint-meta code { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-meta code { font-family: "JetBrains Mono", monospace; }
.documentation-section { margin-top: 20px; }
.documentation-section h3,
.section-heading-row h3 { margin: 0 0 9px; font-size: 12px; }
.section-heading-row { justify-content: space-between; gap: 14px; }
.parameter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.parameter-field { display: grid; gap: 6px; color: #334155; font-size: 10px; font-weight: 600; }
.parameter-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.parameter-label em { color: #94a3b8; font-size: 8px; font-style: normal; font-weight: 500; }
.parameter-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
}
.parameter-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.parameter-field small { color: var(--muted); font-size: 9px; font-weight: 400; }
.empty-note { margin: 0; padding: 11px; color: var(--muted); background: var(--surface); border-radius: 7px; font-size: 10px; }
.code-preview { margin: 0; padding: 14px; overflow: auto; font-size: 10px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.request-actions { margin-top: 20px; gap: 8px; }
.response-panel { background: #fbfcfe; border-top: 1px solid var(--border); }
.response-tools { gap: 8px; color: var(--muted); font-size: 10px; }
.response-data { margin-top: 10px; max-height: 420px; overflow: auto; }
.response-data pre { margin: 0; padding: 15px; color: var(--code-text); font: 400 10px/1.6 "JetBrains Mono", monospace; white-space: pre-wrap; word-break: break-word; }
.response-data img { display: block; max-width: 100%; margin: auto; }
.response-data .retro-button { margin: 14px; }

@media (max-width: 980px) {
  :root { --sidebar-width: 245px; }
  .endpoint-grid { grid-template-columns: 1fr; }
  .header-search { width: min(260px,28vw); }
  .info-grid,
  .support-links { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .docs-header { padding: 0 13px; }
  .mobile-menu-button { display: grid; place-items: center; }
  .docs-brand small,
  .header-link,
  .health-indicator { display: none; }
  .header-search { width: min(250px,46vw); }
  .docs-sidebar {
    width: min(300px,86vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 18px 0 45px rgba(15,23,42,.18);
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-main { width: 100%; margin-left: 0; }
  .docs-section,
  .docs-footer { width: min(100% - 28px,var(--page-width)); }
  .docs-section { padding: 45px 0; }
  .overview-heading { flex-direction: column; gap: 22px; }
  .api-health-card { width: 100%; }
  .info-grid { grid-template-columns: 1fr; }
  .endpoint-meta-grid,
  .parameter-grid { grid-template-columns: 1fr; }
  #api-modal { padding: 8px; align-items: flex-start; }
  .tkm-modal-content { max-height: calc(100vh - 16px); }
}

@media (max-width: 520px) {
  .docs-brand > span:last-child { display: none; }
  .header-search { flex: 1; width: auto; }
  .overview-heading h1 { font-size: 42px; letter-spacing: -2px; }
  .overview-heading p { font-size: 15px; }
  .section-heading h2 { font-size: 23px; }
  .base-url-box { align-items: stretch; flex-direction: column; }
  .base-url-box .copy-button { width: 100%; }
  .endpoint-toolbar { align-items: flex-start; flex-direction: column; }
  .endpoint-toolbar span:first-child { margin-right: 0; }
  .endpoint-card-copy { flex-direction: column; }
  .endpoint-card-actions { justify-content: stretch; }
  .endpoint-card-actions button { flex: 1; }
  .modal-content-inner,
  .response-panel-inner { padding: 17px; }
  .modal-title-copy { flex-direction: column; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .section-heading-row .copy-button { width: 100%; }
  .request-actions { flex-direction: column; }
  .request-actions button { width: 100%; }
  .docs-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}