/* ============================================================
   Nyckel Docs — standalone docs template styles
   Scoped entirely to .docs-page and docs- prefixed selectors.
   Zero impact on marketing site.

   Fonts  : Inter (body), JetBrains Mono (code)
   Colors : Blue #1e5c97 | Orange #d4932e | Green #16a34a
   ============================================================ */

/* ── CSS Variables — Light Mode ── */
:root,
[data-theme="light"] {
  --docs-font:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --docs-mono:    "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --docs-blue:    #1e5c97;
  --docs-blue-hover: #155082;
  --docs-orange:  #d4932e;
  --docs-green:   #16a34a;
  --docs-red:     #dc2626;

  /* Surfaces */
  --docs-bg:          #ffffff;
  --docs-bg-subtle:   #f6f8fa;
  --docs-bg-hover:    #f0f3f7;
  --docs-bg-active:   #eef3fb;

  /* Borders */
  --docs-border:        #d0d7de;
  --docs-border-subtle: #e8ecf0;

  /* Text */
  --docs-text:        #1c1e21;
  --docs-text-muted:  #57606a;
  --docs-text-light:  #6e7781;

  /* Code */
  --docs-code-bg:     #f3f4f6;
  --docs-code-border: #e1e4e8;
  --docs-code-text:   #1c2b4a;
  --docs-block-bg:    #161b22;
  --docs-block-text:  #e6edf3;
  --docs-block-border:#30363d;

  /* Header */
  --docs-header-bg:     #ffffff;
  --docs-header-border: #e1e4e8;
  --docs-header-h:      52px;

  /* Sidebar */
  --docs-sidebar-w:     220px;

  /* Content */
  --docs-content-max:   680px;

  /* Radii */
  --docs-r:   5px;
  --docs-r-lg:8px;
}

/* ── CSS Variables — Dark Mode ── */
[data-theme="dark"] {
  --docs-bg:          #0d1117;
  --docs-bg-subtle:   #161b22;
  --docs-bg-hover:    #1c2330;
  --docs-bg-active:   #1a2744;

  --docs-border:        #30363d;
  --docs-border-subtle: #21262d;

  --docs-text:        #e6edf3;
  --docs-text-muted:  #8b949e;
  --docs-text-light:  #6e7681;

  --docs-code-bg:     #1c2330;
  --docs-code-border: #30363d;
  --docs-code-text:   #c9d1d9;
  --docs-block-bg:    #010409;
  --docs-block-text:  #c9d1d9;
  --docs-block-border:#30363d;

  --docs-header-bg:     #161b22;
  --docs-header-border: #30363d;

  --docs-blue:    #58a6ff;
  --docs-blue-hover: #79b8ff;
}

/* ── Base reset for docs page ── */
.docs-page {
  margin: 0;
  padding: 0;
  font-family: var(--docs-font);
  font-size: 13.5px;
  line-height: 1.7;
  background: var(--docs-bg);
  color: var(--docs-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Three-column fixed layout: only content column scrolls */
  overflow: hidden;
  height: 100vh;
}

/* ════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════ */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--docs-header-bg);
  border-bottom: 1px solid var(--docs-header-border);
  height: var(--docs-header-h);
}

.docs-header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
  gap: 0;
}

/* Brand — exactly as wide as the sidebar so nav tabs align with sidebar content */
.docs-header-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  width: var(--docs-sidebar-w);
  min-width: var(--docs-sidebar-w);
}

.docs-brand-home {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.docs-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #1e5c97;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--docs-font);
  border-radius: 5px;
  line-height: 1;
  flex-shrink: 0;
}

[data-theme="dark"] .docs-logo-icon {
  background: #58a6ff;
  color: #0d1117;
}

.docs-logo-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--docs-text);
  letter-spacing: -0.01em;
}

.docs-logo-divider {
  font-size: 0.9rem;
  color: var(--docs-border);
  font-weight: 300;
  margin: 0 0.1rem;
  user-select: none;
}

.docs-logo-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--docs-text-muted);
  text-decoration: none;
  letter-spacing: 0.005em;
}

.docs-logo-label:hover {
  color: var(--docs-blue);
  text-decoration: none;
}

/* Center nav tabs */
.docs-header-nav {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
  gap: 0.15rem;
  overflow: hidden;
  padding-left: 0.625rem;
}

.docs-header-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: 20px;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
  letter-spacing: 0.01em;
}

.docs-header-tab:hover {
  color: var(--docs-text);
  background: var(--docs-bg-subtle);
  text-decoration: none;
}

.docs-header-tab--active {
  color: var(--docs-blue);
  background: var(--docs-bg-active);
  font-weight: 600;
}

/* Right actions */
.docs-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.docs-header-api {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--docs-text-muted);
  text-decoration: none;
  border: 1px solid var(--docs-border-subtle);
  border-radius: var(--docs-r);
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.docs-header-api:hover,
.docs-header-api--active {
  color: var(--docs-blue);
  border-color: var(--docs-blue);
  background: var(--docs-bg-active);
  text-decoration: none;
}

.docs-api-icon {
  font-size: 0.8rem;
  font-family: var(--docs-mono);
  font-weight: 700;
  opacity: 0.75;
}

/* Theme toggle */
.docs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--docs-border-subtle);
  border-radius: var(--docs-r);
  color: var(--docs-text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.docs-theme-toggle:hover {
  color: var(--docs-text);
  background: var(--docs-bg-subtle);
  border-color: var(--docs-border);
}

/* Show sun in dark mode, moon in light mode */
[data-theme="light"] .docs-icon-moon { display: none; }
[data-theme="dark"]  .docs-icon-sun  { display: none; }

/* Separator */
.docs-header-sep {
  width: 1px;
  height: 18px;
  background: var(--docs-border);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* Auth buttons */
.docs-btn-login {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--docs-font);
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: var(--docs-r);
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.docs-btn-login:hover {
  color: var(--docs-text);
  background: var(--docs-bg-subtle);
  text-decoration: none;
}

.docs-btn-signup {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  font-size: 0.775rem;
  font-weight: 600;
  font-family: var(--docs-font);
  color: #fff;
  background: #1e5c97;
  text-decoration: none;
  border-radius: var(--docs-r);
  white-space: nowrap;
  transition: background 0.12s;
}

.docs-btn-signup:hover {
  background: #155082;
  color: #fff;
  text-decoration: none;
}

[data-theme="dark"] .docs-btn-signup {
  background: #238636;
}

[data-theme="dark"] .docs-btn-signup:hover {
  background: #2ea043;
}

/* Mobile menu button — hidden on desktop */
.docs-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--docs-border-subtle);
  border-radius: var(--docs-r);
  color: var(--docs-text-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Mobile dropdown menu ── */
.docs-mobile-menu {
  display: none;
  position: fixed;
  top: var(--docs-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--docs-bg);
  border-top: 1px solid var(--docs-border);
  z-index: 199;
  overflow-y: auto;
}

.docs-mobile-menu--open {
  display: block;
}

.docs-mobile-menu-inner {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.docs-mobile-menu-section {
  border-bottom: 1px solid var(--docs-border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.docs-mobile-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--docs-text-light);
  padding: 0.4rem 0.5rem 0.2rem;
}

.docs-mobile-tab {
  display: block;
  padding: 0.45rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: var(--docs-r);
}

.docs-mobile-tab:hover,
.docs-mobile-tab--active {
  color: var(--docs-blue);
  background: var(--docs-bg-active);
  text-decoration: none;
}

.docs-mobile-link {
  display: block;
  padding: 0.38rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: var(--docs-r);
}

.docs-mobile-link:hover { color: var(--docs-text); text-decoration: none; }
.docs-mobile-link--active { color: var(--docs-blue); font-weight: 600; }

.docs-mobile-menu-footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

/* ════════════════════════════════════════════════
   LAYOUT: Sidebar + Content
════════════════════════════════════════════════ */
.docs-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: calc(100vh - var(--docs-header-h));
  overflow: hidden;
}

/* ── Sidebar ── */
.docs-sidebar {
  width: var(--docs-sidebar-w);
  flex-shrink: 0;
  padding: 1.5rem 1rem 2rem 0;
  border-right: 1px solid var(--docs-border-subtle);
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--docs-border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 3px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--docs-border); border-radius: 2px; }


.docs-sidebar-section {
  margin-bottom: 1.25rem;
}

.docs-sidebar-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-text-light);
  padding: 0.15rem 0.5rem 0.3rem;
}

.docs-sidebar-link {
  display: block;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: var(--docs-r);
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  line-height: 1.4;
}

.docs-sidebar-link:hover {
  background: var(--docs-bg-hover);
  color: var(--docs-text);
  text-decoration: none;
  border-left-color: var(--docs-border);
}

.docs-sidebar-link.docs-sidebar-active {
  background: var(--docs-bg-active);
  color: var(--docs-blue);
  font-weight: 600;
  border-left-color: var(--docs-blue);
}

/* ── Content ── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 1rem 4rem 2.5rem;
  max-width: var(--docs-content-max);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  /* Hide scrollbar when TOC column is visible — the TOC makes it obvious where you are */
  scrollbar-width: none;
}
.docs-content::-webkit-scrollbar { display: none; }

/* Full-width content (pages with hide_toc: true) */
.docs-content--full {
  max-width: none;
  padding-right: 3rem;
}

/* ── Welcome / landing cards ── */
.docs-start-intro {
  font-size: 1.05rem;
  color: var(--docs-text-muted);
  margin: 0.25rem 0 2.5rem;
  max-width: 580px;
  line-height: 1.65;
}

.docs-start-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
  .docs-start-cards { grid-template-columns: 1fr; }
}

.docs-start-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  text-decoration: none;
  background: var(--docs-bg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.docs-start-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--docs-start-accent, var(--docs-blue));
  border-radius: 8px 8px 0 0;
}

.docs-start-card:hover {
  border-color: var(--docs-blue);
  box-shadow: 0 4px 16px rgba(30, 92, 151, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}

.docs-start-card--dev {
  --docs-start-accent: #1a1a1a;
}

.docs-start-card--dev:hover {
  border-color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .docs-start-card--dev {
  --docs-start-accent: #e2e2e2;
}

[data-theme="dark"] .docs-start-card--dev:hover {
  border-color: #e2e2e2;
}

.docs-start-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--docs-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--docs-start-accent, var(--docs-blue));
  flex-shrink: 0;
}

.docs-start-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--docs-text);
  line-height: 1.3;
}

.docs-start-card-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--docs-start-accent, var(--docs-blue));
  background: color-mix(in srgb, var(--docs-start-accent, var(--docs-blue)) 10%, transparent);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  width: fit-content;
}

.docs-start-card-desc {
  font-size: 0.85rem;
  color: var(--docs-text-muted);
  line-height: 1.6;
  flex: 1;
}

.docs-start-card-desc li {
  list-style: none;
  padding-left: 0;
}

.docs-start-card-cta {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--docs-start-accent, var(--docs-blue));
  margin-top: 0.25rem;
}

.docs-start-note {
  font-size: 0.82rem;
  color: var(--docs-text-light);
  border-top: 1px solid var(--docs-border);
  padding-top: 1.5rem;
  line-height: 1.6;
}

.docs-start-note a {
  color: var(--docs-blue);
}

/* ── Mini cards (secondary entry points) ── */
.docs-start-mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
  .docs-start-mini-cards { grid-template-columns: 1fr; }
}

.docs-start-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--docs-border);
  border-radius: 7px;
  text-decoration: none;
  background: var(--docs-bg);
  transition: border-color 0.15s, background 0.15s;
}

.docs-start-mini-card:hover {
  border-color: var(--docs-blue);
  background: var(--docs-bg-hover);
  text-decoration: none;
}

.docs-start-mini-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--docs-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--docs-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-start-mini-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--docs-text);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.docs-start-mini-card-desc {
  font-size: 0.77rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
}

.docs-content .docs-start-mini-card,
.docs-content .docs-start-mini-card *,
.docs-content .docs-start-mini-card:hover,
.docs-content .docs-start-mini-card:hover * {
  text-decoration: none;
}

/* ── On this page (TOC) ── */
.docs-toc {
  width: 176px;
  flex-shrink: 0;
  padding: 1.75rem 0 2rem 1.5rem;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}
.docs-toc::-webkit-scrollbar { display: none; }

.docs-toc-inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.docs-toc-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-text-light);
  padding: 0.15rem 0.5rem 0.45rem;
}

.docs-toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.42rem 0.5rem;
  font-size: 0.775rem;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: 0 var(--docs-r) var(--docs-r) 0;
  border-left: 2px solid transparent;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
  line-height: 1.35;
}

.docs-toc-link:hover {
  color: var(--docs-text);
  background: var(--docs-bg-hover);
  text-decoration: none;
}

.docs-toc-link--sub {
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--docs-text-light);
}

.docs-toc-link--active {
  color: var(--docs-blue);
  border-left-color: var(--docs-blue);
  font-weight: 500;
}

.docs-toc-step-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--docs-text-light);
  min-width: 12px;
  flex-shrink: 0;
}

.docs-toc-link--active .docs-toc-step-num {
  color: var(--docs-blue);
}

/* ── Floating TOC trigger (narrow screens) ── */
.docs-toc-float-btn {
  display: none;
  position: fixed;
  top: calc(var(--docs-header-h) + 0.75rem);
  right: 1rem;
  z-index: 200;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  background: var(--docs-bg);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r);
  color: var(--docs-text-muted);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}

.docs-toc-float-btn:hover {
  color: var(--docs-text);
  border-color: var(--docs-border);
  background: var(--docs-bg-subtle);
}

.docs-toc-float-panel {
  display: none;
  position: fixed;
  top: calc(var(--docs-header-h) + 3rem);
  right: 1rem;
  z-index: 200;
  min-width: 200px;
  max-width: 260px;
  background: var(--docs-bg);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 0.6rem 0;
  max-height: calc(100vh - var(--docs-header-h) - 4rem);
  overflow-y: auto;
}

.docs-toc-float-panel--open {
  display: block;
}

.docs-toc-float-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-text-light);
  padding: 0.1rem 0.75rem 0.4rem;
}

.docs-toc-float-panel .docs-toc-link {
  border-left: none;
  padding: 0.38rem 0.75rem;
  border-radius: 0;
}

.docs-toc-float-panel .docs-toc-link--sub {
  padding-left: 1.25rem;
}

.docs-toc-float-panel .docs-toc-link--active {
  background: var(--docs-bg-active);
}

/* ── Sidebar sub-steps ── */
.docs-sidebar-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0.15rem 0 0.35rem 0.75rem;
  border-left: 1px solid var(--docs-border-subtle);
  padding-left: 0;
}

.docs-sidebar-substep {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.5rem 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-radius: var(--docs-r);
  transition: color 0.1s, background 0.1s;
  line-height: 1.35;
}

.docs-sidebar-substep:hover {
  color: var(--docs-text);
  background: var(--docs-bg-hover);
  text-decoration: none;
}

.docs-sidebar-substep-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  background: var(--docs-border);
  color: var(--docs-text-muted);
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}

.docs-sidebar-substep:hover .docs-sidebar-substep-num {
  background: var(--docs-blue);
  color: #fff;
}

/* ════════════════════════════════════════════════
   TYPOGRAPHY
════════════════════════════════════════════════ */
.docs-content h1 {
  font-family: var(--docs-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--docs-text);
  margin: 0 0 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.docs-content h2 {
  font-family: var(--docs-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--docs-text);
  margin: 1.25rem 0 0.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--docs-header-h) + 1rem);
}

.docs-content hr {
  border: none;
  border-top: 1px solid var(--docs-border-subtle);
  margin: 1.5rem 0 0;
}

.docs-content h3 {
  font-family: var(--docs-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--docs-text);
  margin: 1.5rem 0 0.4rem;
  line-height: 1.4;
  scroll-margin-top: calc(var(--docs-header-h) + 1rem);
}

.docs-content h4 {
  font-family: var(--docs-font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--docs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.35rem;
}

.docs-content p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--docs-text);
  margin: 0 0 0.875rem;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.4rem;
  margin: 0 0 0.875rem;
}

.docs-content li {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--docs-text);
  margin-bottom: 0.25rem;
}

.docs-content a {
  color: var(--docs-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.docs-content a:hover {
  color: var(--docs-blue-hover);
}

/* ── Developer Platform: charcoal links ── */
[data-tab="developer-guide"] .docs-content a {
  color: #374151;
}

[data-tab="developer-guide"] .docs-content a:hover {
  color: #111827;
}

[data-theme="dark"] [data-tab="developer-guide"] .docs-content a {
  color: #d1d5db;
}

[data-theme="dark"] [data-tab="developer-guide"] .docs-content a:hover {
  color: #f3f4f6;
}

.docs-content .docs-start-card,
.docs-content .docs-start-card *,
.docs-content .docs-start-card:hover,
.docs-content .docs-start-card:hover * {
  text-decoration: none;
}

/* ── Lead paragraph (first p after h1) ── */
.docs-content > h1 + p {
  font-size: 0.9375rem;
  color: var(--docs-text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--docs-border-subtle);
}

/* ── Inline Code ── */
.docs-content code {
  background: var(--docs-code-bg);
  color: var(--docs-code-text);
  border: 1px solid var(--docs-code-border);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  font-size: 0.82em;
  font-family: var(--docs-mono);
  font-weight: 500;
  word-break: break-word;
}

/* ── Code Blocks ── */
.docs-content pre {
  background: var(--docs-block-bg);
  color: var(--docs-block-text);
  border: 1px solid var(--docs-block-border);
  border-radius: var(--docs-r-lg);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0.875rem 0 1.25rem;
  font-size: 0.78rem;
  line-height: 1.65;
}

.docs-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border: none;
  font-family: var(--docs-mono);
  font-weight: 400;
  word-break: normal;
}

/* ── Tables ── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0.875rem 0 1.25rem;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r);
}

.docs-content th {
  text-align: left;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--docs-text-muted);
  border-bottom: 1px solid var(--docs-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--docs-bg-subtle);
  white-space: nowrap;
}

.docs-content td {
  padding: 0.45rem 0.8rem;
  border-bottom: 1px solid var(--docs-border-subtle);
  vertical-align: top;
  line-height: 1.5;
  font-size: 0.8125rem;
}

.docs-content tr:last-child td { border-bottom: none; }
.docs-content tbody tr:hover td { background: var(--docs-bg-subtle); }

/* ── Blockquote ── */
.docs-content blockquote {
  border-left: 3px solid var(--docs-blue);
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  background: var(--docs-bg-active);
  border-radius: 0 var(--docs-r) var(--docs-r) 0;
  color: var(--docs-text-muted);
  font-style: normal;
}

.docs-content blockquote p {
  margin: 0;
  font-size: 0.875rem;
}

/* ── Tutorial Meta Block ── */
.docs-tutorial-meta {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r);
  background: var(--docs-bg-active);
  margin: 1.25rem 0 1.75rem;
  overflow: hidden;
  padding: 0.9rem 1.25rem;
  gap: 0.75rem;
}

.docs-tutorial-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.docs-tutorial-meta-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--docs-text-muted);
  flex: 0 0 46px;
}

.docs-tutorial-meta-value {
  font-size: 0.875rem;
  color: var(--docs-text);
  line-height: 1.55;
  margin: 0;
}

/* ── SMS Paste Blocks ── */
.docs-sms-group {
  background: #e9ebee;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 0.75rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.docs-sms-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--docs-border-subtle);
  border-radius: 18px 18px 18px 4px;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  font-family: var(--docs-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--docs-text);
}

.docs-sms-text {
  flex: 1;
  word-break: break-word;
}

.docs-copy-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  font-size: 0.62rem;
  font-family: var(--docs-font);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--docs-text-muted);
  background: var(--docs-bg-subtle);
  border: 1px solid var(--docs-border);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.6;
  white-space: nowrap;
}

.docs-copy-btn:hover {
  color: var(--docs-blue);
  border-color: var(--docs-blue);
}

.docs-copy-btn.copied {
  color: var(--docs-green);
  border-color: var(--docs-green);
}

/* ── Result Block ── */
.docs-result-block {
  background: var(--docs-bg-active);
  border: 1px solid var(--docs-border-subtle);
  border-radius: var(--docs-r);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  font-family: var(--docs-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--docs-text);
}

.docs-result-key   { color: var(--docs-blue); }
.docs-result-str   { color: var(--docs-green); }
.docs-result-num   { color: var(--docs-orange); }

/* ── Callout Boxes ── */
.docs-callout {
  border-radius: var(--docs-r-lg);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.8125rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  line-height: 1.6;
}

.docs-callout-note {
  background: var(--docs-bg-active);
  border: 1px solid #c8daf2;
}

[data-theme="dark"] .docs-callout-note {
  border-color: #1f3a5f;
}

.docs-callout-tip {
  background: #f0faf2;
  border: 1px solid #bbf7d0;
}

[data-theme="dark"] .docs-callout-tip {
  background: #0d2818;
  border-color: #1a4731;
}

.docs-callout-icon {
  font-style: normal;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  flex-shrink: 0;
  padding-top: 0.18rem;
}

.docs-callout-note .docs-callout-icon { color: var(--docs-blue); }
.docs-callout-tip  .docs-callout-icon { color: var(--docs-green); }

.docs-callout p {
  margin: 0;
  font-size: inherit;
  color: var(--docs-text);
}

/* ── Loop Diagram ── */
.docs-loop {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.75rem;
  font-family: var(--docs-font);
}

.docs-loop-step {
  background: #1e5c97;
  color: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .docs-loop-step {
  background: #58a6ff;
  color: #0d1117;
}

.docs-loop-arrow {
  color: var(--docs-orange);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Platform parts (three-column breakdown) ── */
.docs-platform-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

@media (max-width: 900px) {
  .docs-platform-parts { grid-template-columns: 1fr; }
}

.docs-platform-part {
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r);
  padding: 1rem 1.1rem 1rem;
}

.docs-platform-part-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--docs-text);
  margin-bottom: 0.65rem;
}

.docs-platform-part ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.docs-platform-part li {
  font-size: 0.8rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
}

/* ── Card Grid ── */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}

.docs-card {
  background: var(--docs-bg);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r-lg);
  padding: 0.9rem 1rem;
  text-decoration: none;
  display: block;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.docs-card:hover {
  border-color: var(--docs-blue);
  background: var(--docs-bg-active);
  box-shadow: 0 2px 8px rgba(30, 92, 151, 0.08);
  text-decoration: none;
}

.docs-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--docs-blue);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.docs-card-desc {
  font-size: 0.75rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
}

/* ── Prev / Next ── */
.docs-prevnext {
  display: flex;
  justify-content: space-between;
  gap: 0.625rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--docs-border-subtle);
}

.docs-prevnext-link,
.docs-content .docs-prevnext-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  background: var(--docs-bg);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-r-lg);
  text-decoration: none;
  flex: 1;
  max-width: 48%;
  transition: border-color 0.12s, background 0.12s;
}

.docs-prevnext-link:hover,
.docs-content .docs-prevnext-link:hover {
  border-color: var(--docs-blue);
  background: var(--docs-bg-active);
  text-decoration: none;
}

.docs-content .docs-prevnext-link *,
.docs-content .docs-prevnext-link *:hover {
  text-decoration: none;
}

.docs-prevnext-direction {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--docs-text-light);
}

.docs-prevnext-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--docs-blue);
  line-height: 1.35;
  text-decoration: none;
}

.docs-prevnext-link--next { text-align: right; margin-left: auto; }
.docs-prevnext-empty { flex: 1; }

/* ── HTTP Method Badges ── */
.docs-method {
  display: inline-block;
  font-family: var(--docs-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18em 0.5em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.docs-method-post   { background: #166534; color: #dcfce7; }
.docs-method-get    { background: #1d4ed8; color: #dbeafe; }
.docs-method-put    { background: #92400e; color: #fef3c7; }
.docs-method-delete { background: #991b1b; color: #fee2e2; }

/* ── Endpoint Block ── */
.docs-endpoint {
  background: var(--docs-block-bg);
  color: var(--docs-block-text);
  border: 1px solid var(--docs-block-border);
  border-radius: var(--docs-r-lg);
  padding: 0.75rem 1rem;
  font-family: var(--docs-mono);
  font-size: 0.775rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
}

/* ════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════ */
.docs-footer {
  border-top: 1px solid var(--docs-border-subtle);
  background: var(--docs-bg-subtle);
  padding: 1rem 0;
  margin-top: 2rem;
}

.docs-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.docs-footer-copy {
  font-size: 0.75rem;
  color: var(--docs-text-light);
}

.docs-footer-links {
  display: flex;
  gap: 1.25rem;
}

.docs-footer-links a {
  font-size: 0.75rem;
  color: var(--docs-text-muted);
  text-decoration: none;
}

.docs-footer-links a:hover {
  color: var(--docs-blue);
  text-decoration: underline;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  /* Hide sticky TOC column, show floating trigger instead */
  .docs-toc {
    display: none;
  }
  .docs-toc-float-btn {
    display: inline-flex;
  }
  /* Restore scrollbar on content when TOC column is gone */
  .docs-content {
    scrollbar-width: thin;
    scrollbar-color: var(--docs-border) transparent;
  }
  .docs-content::-webkit-scrollbar { display: block; width: 4px; }
  .docs-content::-webkit-scrollbar-track { background: transparent; }
  .docs-content::-webkit-scrollbar-thumb { background: var(--docs-border); border-radius: 2px; }
}

@media (max-width: 1024px) {
  .docs-layout {
    padding: 0 1rem;
  }
  .docs-content {
    padding-left: 1.75rem;
  }
}

@media (max-width: 768px) {
  /* Hide desktop nav in header, show mobile button */
  .docs-header-nav,
  .docs-header-api,
  .docs-header-sep,
  .docs-btn-login,
  .docs-btn-signup,
  .docs-theme-toggle {
    display: none;
  }

  .docs-mobile-menu-btn {
    display: inline-flex;
  }

  /* Show theme toggle in mobile too */
  .docs-header-actions {
    gap: 0.5rem;
  }

  /* Re-show theme toggle on mobile */
  .docs-header-actions .docs-theme-toggle {
    display: inline-flex;
  }

  /* Sidebar collapses — hidden on mobile (use mobile menu instead) */
  .docs-sidebar {
    display: none;
  }

  /* Revert fixed layout on mobile — let the page scroll normally */
  .docs-page {
    overflow: auto;
    height: auto;
  }

  .docs-layout {
    flex-direction: column;
    padding: 0 1rem;
    height: auto;
    overflow: visible;
  }

  .docs-content {
    padding: 1.5rem 0 3rem;
    max-width: 100%;
    height: auto;
    overflow-y: visible;
  }

  .docs-content h1 { font-size: 1.25rem; }
  .docs-content h2 { font-size: 0.9375rem; }

  .docs-prevnext {
    flex-direction: column;
  }

  .docs-prevnext-link {
    max-width: 100%;
  }

  .docs-prevnext-link--next {
    text-align: left;
    margin-left: 0;
  }

  .docs-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .docs-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .docs-header-inner {
    padding: 0 1rem;
  }

  .docs-layout {
    padding: 0 0.875rem;
  }
}
