:root {
  --bg: #ffffff;
  --sidebar: #fafafa;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --soft: #f8fafc;
  --accent: #111827;
  --code-bg: #111827;
  --code-top: #1f2937;
  --code-text: #f9fafb;
  --code-muted: #cbd5e1;
  --post: #0f766e;
  --get: #1d4ed8;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --body-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --code-font: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --sidebar: #0f172a;
  --line: #243043;
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #111827;
  --accent: #f8fafc;
  --code-bg: #020617;
  --code-top: #0f172a;
  --code-text: #e2e8f0;
  --code-muted: #94a3b8;
  --link: #60a5fa;
  --link-hover: #93c5fd;
  --panel: #111827;
  --panel-soft: #0f172a;
}

* {
  box-sizing: border-box;
  font-style: normal !important;
  font-synthesis: none;
  font-oblique: 0deg !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font) !important;
  font-style: normal !important;
}

.docs-shell,
.docs-shell * {
  font-family: var(--body-font) !important;
  font-style: normal !important;
  font-oblique: 0deg !important;
}

a,
button,
input,
select,
textarea,
label,
span,
p,
h1,
h2,
h3,
li,
strong,
em,
i,
div,
small,
th,
td,
code,
pre {
  font-style: normal !important;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: var(--code-font);
  font-style: normal !important;
}

.docs-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-inner {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  overflow: hidden;
  padding: 18px 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-docs {
  color: #667085;
  font-family: var(--body-font) !important;
  font-weight: 700;
  font-style: normal !important;
}

.sidebar-nav {
  overflow-y: auto;
  padding-bottom: 24px;
  min-height: 0;
}

.sidebar-group + .sidebar-group {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-label {
  margin: 0 0 10px;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-link {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  color: #334155;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #f3f4f6;
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  min-height: 92px;
  margin: 0 -18px;
  padding: 14px 18px 10px;
  border-top: 1px solid var(--line);
  background: #fbfbfd;
  box-shadow: 0 -1px 0 rgba(229, 231, 235, 1);
}

html[data-theme="dark"] .sidebar-footer {
  background: #0f172a;
  box-shadow: 0 -1px 0 rgba(36, 48, 67, 1);
}

.lang-label {
  color: #4b5563;
  font-size: 0.88rem;
  font-weight: 600;
}

html[data-theme="dark"] .lang-label {
  color: #cbd5e1;
}

.lang-dropdown {
  position: relative;
}

.lang-trigger {
  width: 100%;
  min-height: 44px;
  padding: 0 40px 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--body-font);
  font-size: 0.96rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  font-size: 18px;
  line-height: 1;
}

html[data-theme="dark"] .lang-trigger {
  border-color: #334155;
  background: #111827;
}

html[data-theme="dark"] .theme-toggle {
  border-color: #334155;
  background: #111827;
  color: #cbd5e1;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: #1e293b;
  border-color: #475569;
}

.lang-dropdown::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.18s ease;
}

html[data-theme="dark"] .lang-dropdown::after {
  border-right-color: #94a3b8;
  border-bottom-color: #94a3b8;
}

.lang-dropdown.open::after {
  transform: translateY(-30%) rotate(-135deg);
}

.lang-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: none;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

html[data-theme="dark"] .lang-menu {
  border-color: #334155;
  background: #111827;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.45);
}

.lang-dropdown.open .lang-menu {
  display: grid;
  gap: 6px;
}

.lang-option {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #374151;
  font-family: var(--body-font);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .lang-option {
  color: #e2e8f0;
}

.lang-option:hover,
.lang-option.active {
  background: #f3f4f6;
}

html[data-theme="dark"] .lang-option:hover,
html[data-theme="dark"] .lang-option.active {
  background: #1e293b;
}

.content {
  max-width: 800px;
  padding: 40px 44px 80px;
}

.hero-section {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 14px;
  color: #667085;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

html[data-theme="dark"] .eyebrow {
  color: #94a3b8;
}

h1 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h3 {
  margin: 18px 0 10px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}

.lead,
.doc-section p,
.doc-section li {
  color: #374151;
  font-size: 15px;
  line-height: 1.6;
}

html[data-theme="dark"] .lead,
html[data-theme="dark"] .doc-section p,
html[data-theme="dark"] .doc-section li {
  color: #cbd5e1;
}

.lead-secondary {
  margin-top: 0;
}

.note-panel,
.callout-box {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 14px;
}

html[data-theme="dark"] .note-panel,
html[data-theme="dark"] .callout-box {
  background: #111827;
}

.note-panel strong,
.callout-box strong {
  display: block;
  margin-bottom: 8px;
}

.doc-section {
  padding-top: 40px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.doc-table th,
.doc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
  line-height: 1.6;
}

.doc-table th:last-child,
.doc-table td:last-child {
  border-right: 0;
}

.doc-table thead th {
  background: var(--soft);
  color: var(--text);
  font-weight: 700;
}

.content a {
  color: var(--link);
}

.content a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.endpoint-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.method-badge.post {
  background: var(--post);
}

.method-badge.get {
  background: var(--get);
}

.endpoint-path {
  font-size: 1rem;
  color: var(--text);
}

.code-panel {
  margin-top: 18px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
}

.code-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  background: var(--code-top);
  color: var(--code-muted);
  font-size: 13px;
  font-weight: 500;
}

.code-panel pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.copy-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

html[data-theme="dark"] .copy-btn {
  border-color: #334155;
  background: #111827;
  color: #e2e8f0;
}

.copy-btn:hover {
  background: #f9fafb;
}

html[data-theme="dark"] .copy-btn:hover {
  background: #1e293b;
}

.ordered-flow {
  padding-left: 22px;
}

.ordered-flow-tight li + li {
  margin-top: 6px;
}

.screen-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.pos-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.pos-window-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.pos-window-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #374151;
}

html[data-theme="dark"] .pos-window-label {
  color: #cbd5e1;
}

.pos-window-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.pos-window-state.success {
  background: #e8f7ef;
  color: #166534;
}

.pos-window-state.accent {
  background: #fff4e8;
  color: #b45309;
}

.pos-window-body {
  padding: 20px 22px 24px;
}

.brand,
.brand-docs,
.sidebar-label,
.sidebar-link,
.content h1,
.content h2,
.content h3,
.content p,
.content li,
.content th,
.content td,
.content strong,
.content span,
.content div {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
  font-style: normal !important;
  font-oblique: 0deg !important;
}

.doc-table th,
.doc-table td,
.doc-table code,
.doc-table strong,
.doc-table span {
  font-style: normal !important;
}

@media (max-width: 1080px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-inner {
    position: static;
    height: auto;
    overflow: visible;
    display: block;
    padding: 18px;
  }

  .sidebar-nav {
    overflow: visible;
    padding-bottom: 14px;
  }

  .sidebar-footer {
    min-height: 0;
    margin: 0;
    padding: 14px 0 6px;
    box-shadow: none;
  }

  .content {
    padding: 28px 18px 60px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }
}
