/* ===== Docs Page ===== */

.docs-body { background: var(--bg); }
.docs-body::before { display: none !important; }

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 20px) 32px 0;
  min-height: 100vh;
  gap: 40px;
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; padding: calc(var(--header-height) + 20px) 20px 0; }
  .docs-sidebar { display: none; }
}

/* ---------- Sidebar ---------- */
.docs-sidebar-inner {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
  padding-bottom: 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

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

.docs-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.docs-search:focus-within { border-color: rgba(255, 140, 26, 0.3); }

.docs-search svg { color: var(--text-dim); flex-shrink: 0; }

.docs-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.docs-search input::placeholder { color: var(--text-dim); }

.docs-search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.docs-nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  padding: 0 12px 10px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 180ms var(--ease);
}

.docs-nav-link svg {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 180ms var(--ease);
}

.docs-nav-link:hover {
  background: var(--bg-card);
  color: var(--text);
}

.docs-nav-link:hover svg { color: var(--text-muted); }

.docs-nav-link.active {
  background: var(--orange-dim);
  color: var(--orange);
}

.docs-nav-link.active svg { color: var(--orange); }

.docs-nav-link.sub {
  padding-left: 34px;
  font-size: 12.5px;
}

/* Submenu - animated */
.docs-nav-submenu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 180ms var(--ease);
}

.docs-nav-submenu-trigger > svg:first-child { color: var(--text-dim); flex-shrink: 0; transition: color 180ms var(--ease); }
.docs-nav-submenu-trigger span { flex: 1; }

.docs-nav-submenu-trigger:hover {
  background: var(--bg-card);
  color: var(--text);
}

.docs-nav-submenu-trigger:hover > svg:first-child { color: var(--text-muted); }

.docs-nav-submenu-trigger .chev {
  color: var(--text-dim);
  transition: transform 250ms var(--ease);
}

.docs-nav-submenu-trigger[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

.docs-nav-submenu-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms var(--ease);
  overflow: hidden;
}

.docs-nav-submenu-items > * {
  min-height: 0;
}

.docs-nav-submenu-trigger[aria-expanded="true"] + .docs-nav-submenu-items {
  grid-template-rows: 1fr;
}

.docs-nav-submenu-items-inner {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
}

.docs-nav-submenu-items-inner::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}

/* ---------- Main ---------- */
.docs-main {
  padding: 20px 0 80px;
  min-width: 0;
}

.docs-main-inner {
  max-width: 820px;
}

/* Page animations */
.docs-page {
  display: none;
}

.docs-page.active {
  display: block;
  animation: pageSlideIn 400ms var(--ease);
}

@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.docs-breadcrumb svg { color: var(--text-dim); }
.docs-breadcrumb .current { color: var(--text); font-weight: 500; }

.docs-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  line-height: 1.1;
}

.docs-lead {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.docs-h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 44px 0 16px;
}

.docs-body {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.docs-body strong { color: var(--text); font-weight: 600; }

.docs-link {
  color: var(--orange);
  border-bottom: 1px solid rgba(255, 140, 26, 0.4);
  transition: all var(--transition);
}

.docs-link:hover { border-bottom-color: var(--orange); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--orange-bright);
}

/* Welcome Cards */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 28px 0 48px;
}

.docs-card {
  display: block;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: all 220ms var(--ease);
  position: relative;
  overflow: hidden;
}

.docs-card:hover {
  border-color: rgba(255, 140, 26, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.docs-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--orange);
  margin-bottom: 16px;
  transition: all var(--transition);
}

.docs-card:hover .docs-card-icon {
  border-color: rgba(255, 140, 26, 0.3);
  background: var(--orange-dim);
}

.docs-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.docs-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.docs-card-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--text-dim);
  transition: all var(--transition);
}

.docs-card:hover .docs-card-arrow {
  color: var(--orange);
  transform: translateX(3px);
}

/* Scripts list on welcome */
.docs-scripts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 40px;
}

.docs-script-link {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.docs-script-link:hover {
  border-color: rgba(255, 140, 26, 0.25);
  background: var(--bg-card-hover);
}

.docs-script-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--orange-dim);
  border: 1px solid rgba(255, 140, 26, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.docs-script-link > div {
  flex: 1;
}

.docs-script-link h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.docs-script-link p {
  font-size: 12px;
  color: var(--text-muted);
}

.docs-script-link > svg {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: all var(--transition);
}

.docs-script-link:hover > svg {
  color: var(--orange);
  transform: translateX(3px);
}

/* Steps */
.docs-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 20px 0 32px;
  padding: 0;
}

.docs-steps li { display: flex; gap: 16px; align-items: flex-start; }

.docs-step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #000;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.docs-step-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.docs-step-body p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 14px;
}

/* List */
.docs-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  line-height: 1.6;
}

.docs-list li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 11px;
  width: 5px;
  height: 5px;
  background: var(--orange);
  border-radius: 50%;
}

/* Table */
.docs-table-wrap {
  margin: 20px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.docs-table { width: 100%; border-collapse: collapse; }

.docs-table th {
  background: var(--bg-card);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

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

.docs-check {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.docs-dim { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }

.docs-badge-green, .docs-badge-red {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.docs-badge-green { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.25); }
.docs-badge-red { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }

/* Code Block */
.docs-code-block {
  margin: 20px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.docs-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.docs-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

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

.docs-copy.copied {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.docs-code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.docs-code-block code { background: transparent; border: 0; padding: 0; color: var(--text); }

.tok-keyword { color: #c084fc; }
.tok-string { color: #6ee7b7; }
.tok-comment { color: var(--text-dim); font-style: italic; }
.tok-number { color: #fbbf24; }
.tok-bool { color: #60a5fa; }
.tok-prop { color: #f472b6; }

/* Note Box */
.docs-note {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 24px 0;
}

.docs-note-info {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.docs-note-info .docs-note-icon { color: #60a5fa; }
.docs-note-info h4 { color: #60a5fa; }

.docs-note-warn {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.docs-note-warn .docs-note-icon { color: #fbbf24; }
.docs-note-warn h4 { color: #fbbf24; }

.docs-note-icon {
  flex-shrink: 0;
  margin-top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.docs-note-info .docs-note-icon {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.docs-note-warn .docs-note-icon {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.docs-note-icon svg {
  width: 18px;
  height: 18px;
}

.docs-note h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }

.docs-note p { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }

/* Placeholder */
.docs-placeholder {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.docs-placeholder svg {
  margin: 0 auto 16px;
  color: var(--text-dim);
}

.docs-placeholder h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.docs-placeholder p { color: var(--text-muted); }

/* Pagination */
.docs-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.docs-page-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.docs-page-link:hover {
  border-color: rgba(255, 140, 26, 0.3);
  background: var(--bg-card-hover);
}

.docs-page-link.prev { text-align: left; }
.docs-page-link.next { text-align: right; justify-content: flex-end; }

.docs-page-link span {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
}

.docs-page-link strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-top: 4px;
}

.docs-page-link svg { color: var(--text-muted); flex-shrink: 0; }

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