:root {
  --bg: #0c1222;
  --bg-subtle: #141e32;
  --bg-code: #070b14;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(56, 189, 248, 0.1);
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-text: #0c1929;
  --accent-light: rgba(56, 189, 248, 0.12);
  --blue-bg: rgba(14, 165, 233, 0.12);
  --blue-border: rgba(56, 189, 248, 0.25);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --sidebar-w: 240px;
  --toc-w: 180px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body.docs-body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #070b14;
  -webkit-font-smoothing: antialiased;
}

.bg-media {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #070b14 url('../images/bg.jpg') center / cover no-repeat;
  background-attachment: fixed;
}

.bg-media__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 11, 20, 0.15) 0%,
    rgba(7, 11, 20, 0.25) 50%,
    rgba(7, 11, 20, 0.35) 100%
  );
}

.docs-layout {
  position: relative;
  z-index: 1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ===== Header ===== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(12, 18, 34, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.docs-header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-accent { color: var(--accent); }

.docs-topnav {
  display: flex;
  gap: 1.5rem;
  margin-inline: auto;
}

.docs-topnav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}

.docs-topnav a:hover,
.docs-topnav a.active { color: var(--text); font-weight: 500; }

.docs-cta {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-text) !important;
  border-radius: 999px;
  text-decoration: none !important;
}

.docs-cta:hover { background: var(--accent-hover); }

/* ===== Layout ===== */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  max-width: 1280px;
  margin-inline: auto;
  min-height: calc(100vh - var(--header-h));
}

.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 0 2rem 1.5rem;
  border-right: 1px solid var(--border);
}

.sidebar-group { margin-bottom: 1.5rem; }

.sidebar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.sidebar-link {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
  transition: all 150ms;
}

.sidebar-link:hover { color: var(--text); background: var(--bg-subtle); }

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}

.docs-main {
  padding: 2rem 2.5rem 4rem;
  max-width: 720px;
}

.docs-breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.docs-content section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.docs-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.docs-content h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-of-type { border-top: none; margin-top: 1.5rem; }

.docs-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.docs-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.docs-lead:last-of-type {
  margin-bottom: 1.5rem;
}

.docs-list {
  padding-left: 1.25rem;
  margin: 1rem 0;
}

.docs-list li {
  margin-bottom: 0.625rem;
  color: var(--text-muted);
}

.docs-list li strong { color: var(--text); }

.docs-callout {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.docs-callout-info {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  color: var(--accent);
}

/* ===== Pricing ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.pricing-card {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
}

.pricing-featured {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.12);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.pricing-card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.pricing-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pricing-price {
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.pricing-price strong {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--accent);
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.pricing-card li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}

.pricing-card li:last-child { border-bottom: none; }

.pricing-btn {
  display: block;
  text-align: center;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: all 150ms;
}

.pricing-btn:hover { border-color: var(--accent); color: var(--accent); }

.pricing-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text) !important;
}

.pricing-btn-primary:hover { background: var(--accent-hover); color: var(--accent-text) !important; }

/* ===== Plans picker (wireframe layout) ===== */
.plans-picker {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  align-items: start;
}

.plan-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-tab {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
}

.plan-tab:hover { border-color: var(--accent); color: var(--accent); }

.plan-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.plan-tab--hot { box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35); }

.plan-panels { position: relative; min-height: 320px; }

.plan-detail-card {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
}

.plan-detail-card[hidden] { display: none; }

.plan-detail-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: #facc15;
  color: #111;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-detail-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.plan-detail-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.plan-detail-timeline {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.plan-detail-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.plan-detail-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.plan-detail-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.plan-detail-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.35rem 0;
}

.plan-process {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0;
  max-width: 280px;
}

.plan-process-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

.plan-process-row span:first-child { font-weight: 600; color: var(--text); }

.plan-detail-cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text) !important;
  font-size: 0.875rem;
  font-weight: 600;
}

.plan-detail-cta:hover { background: var(--accent-hover); }

@media (max-width: 720px) {
  .plans-picker { grid-template-columns: 1fr; }
  .plan-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .plan-tab { width: auto; flex: 1 1 auto; min-width: 7rem; }
}

/* ===== Online widget ===== */
.online-widget {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(12, 18, 34, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.online-widget--owner { border-color: rgba(250, 204, 21, 0.45); }

.online-widget__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.online-widget__count { color: var(--text); font-variant-numeric: tabular-nums; }

.online-widget__hint { color: rgba(250, 204, 21, 0.85); }

/* ===== Table ===== */
.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-table th,
.docs-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.docs-table tr:last-child td { border-bottom: none; }

/* ===== Code ===== */
.code-block {
  margin: 1rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #27272a;
}

.code-header {
  padding: 0.5rem 1rem;
  background: #27272a;
  font-size: 0.75rem;
  color: #a1a1aa;
}

.code-block pre {
  background: var(--bg-code);
  padding: 1.25rem;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #e4e4e7;
}

.tok-kw { color: #93c5fd; }

/* ===== API-style blocks ===== */
.api-group { margin: 1rem 0; }

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.method {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== FAQ ===== */
.faq-list { margin-top: 1rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  float: right;
  color: var(--text-dim);
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding: 0 1.25rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.faq-item p + p {
  padding-top: 0;
}

.faq-item p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== CTA block ===== */
.docs-cta-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
}

.docs-cta-block h2 { border: none; margin-top: 0; }

.docs-cta-block p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.docs-cta-btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: var(--accent-text) !important;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none !important;
}

.docs-cta-btn:hover { background: var(--accent-hover); }

/* ===== TOC ===== */
.docs-toc {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.toc-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.docs-toc ul { list-style: none; }

.docs-toc a {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.docs-toc a:hover { color: var(--text); }
.docs-toc a.active { color: var(--accent); border-left-color: var(--accent); }

.docs-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

@media (max-width: 1100px) {
  .docs-toc { display: none; }
  .docs-layout { grid-template-columns: var(--sidebar-w) 1fr; }
}

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .docs-main { padding: 1.5rem; }
  .docs-topnav { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.docs-body { background: #0c1222; }
}
