.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  min-width: 0;
  width: 100%;
}
@media (max-width: 840px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 14px 64px;
    gap: 16px;
  }
  .docs-toc {
    position: static !important;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
  }
}
.docs-toc {
  position: sticky;
  top: 72px;
  align-self: start;
  font-size: 13px;
}
.docs-toc h2 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #737373;
  margin-bottom: 10px;
}
.docs-toc a {
  display: block;
  color: #a3a3a3;
  padding: 5px 0;
  text-decoration: none;
}
.docs-toc a:hover { color: #e0e0e0; }
.docs-body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.docs-body h1 {
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.02em;
  color: #f5f5f5;
  margin: 8px 0 12px;
}
.docs-body .lead {
  color: #a3a3a3;
  font-size: 16px;
  margin-bottom: 28px;
  max-width: 640px;
}
.docs-body h2 {
  font-size: 20px;
  color: #f0f0f0;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #222;
}
.docs-body h3 {
  font-size: 15px;
  color: #e5e5e5;
  margin: 22px 0 8px;
}
.docs-body p, .docs-body li {
  color: #c4c4c4;
  font-size: 14.5px;
}
.docs-body ul, .docs-body ol {
  margin: 8px 0 16px 1.2em;
}
.docs-body li { margin: 4px 0; }
.docs-body code, .docs-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 1px 5px;
  color: #93c5fd;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.docs-body pre {
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 18px;
  max-width: 100%;
  min-width: 0;
}
.docs-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: #d4d4d4;
  font-size: 12.5px;
  line-height: 1.55;
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}
.docs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 20px;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  max-width: 100%;
  min-width: 0;
}
.docs-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.docs-body th, .docs-body td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #222;
  vertical-align: top;
}
.docs-body th {
  background: #161616;
  color: #a3a3a3;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.docs-body td { color: #d4d4d4; }
.docs-body tr:last-child td { border-bottom: 0; }
.note {
  background: #141820;
  border: 1px solid #243044;
  border-radius: 10px;
  padding: 12px 14px;
  color: #cbd5e1;
  font-size: 13.5px;
  margin: 12px 0 18px;
}
.note strong { color: #e2e8f0; }
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
}
.hero.docs-hero { padding: 48px 24px 36px; text-align: left; }
.hero.docs-hero .hero-inner { max-width: 1100px; margin: 0 auto; min-width: 0; }
.hero.docs-hero .hero-lead { margin: 0; max-width: 640px; }
@media (max-width: 640px) {
  .hero.docs-hero { padding: 28px 14px 24px; }
  .docs-hub { padding: 8px 14px 64px; }
}

.docs-hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 24px 80px;
  min-width: 0;
  width: 100%;
}
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}
.docs-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  min-height: 160px;
}
.docs-card:hover {
  border-color: #3b82f6;
  background: #16181d;
  text-decoration: none;
}
.docs-card h2 {
  font-size: 18px;
  color: #f0f0f0;
  margin: 0;
  letter-spacing: -0.02em;
}
.docs-card p {
  color: #a3a3a3;
  font-size: 14px;
  margin: 0;
  flex: 1;
}
.docs-card .card-meta {
  font-size: 12px;
  color: #737373;
}
.docs-card.soon {
  opacity: 0.7;
  pointer-events: none;
}
.docs-card .icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1e293b;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Interactive demo page */
.demo-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 8px;
}
@media (max-width: 720px) {
  .demo-steps { grid-template-columns: 1fr; }
}
.demo-step {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 14px 12px;
}
.demo-step .n {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #1e293b;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.demo-step h3 { margin: 0 0 6px; font-size: 14px; color: #f0f0f0; }
.demo-step p { margin: 0; font-size: 13px; color: #a3a3a3; }

.demo-form {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}
.demo-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
@media (max-width: 560px) {
  .demo-row { grid-template-columns: 1fr; }
}
.demo-row label {
  font-size: 13px;
  color: #a3a3a3;
}
.demo-row input[type="text"],
.demo-select,
.demo-css,
.demo-log {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #e5e5e5;
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 8px 10px;
}
.demo-row input[type="text"]:focus,
.demo-select:focus,
.demo-css:focus {
  outline: none;
  border-color: #3b82f6;
}
.demo-name-status {
  font-size: 13px;
  margin: 0 0 10px;
}
.demo-name-status.ok { color: #86efac; }
.demo-name-status.bad { color: #fca5a5; }
.demo-urls {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}
.demo-urls code {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 14px;
}
.demo-toolbar label {
  font-size: 13px;
  color: #a3a3a3;
}
.demo-select {
  min-width: 180px;
  max-width: 100%;
}
.demo-hint {
  font-size: 12px;
  color: #737373;
  margin: 0 0 8px;
}
.demo-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  margin: 12px 0 18px;
}
@media (max-width: 900px) {
  .demo-preview { grid-template-columns: 1fr; }
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.demo-actions .btn { padding: 8px 12px; font-size: 13px; }
.demo-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}
.demo-chip {
  appearance: none;
  background: #161616;
  color: #d4d4d4;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.demo-chip:hover { border-color: #3b82f6; color: #fff; }
.demo-chip.active {
  background: #1e293b;
  border-color: #3b82f6;
  color: #93c5fd;
}

.demo-playground {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  margin: 12px 0 18px;
}
@media (max-width: 900px) {
  .demo-playground { grid-template-columns: 1fr; }
}
.demo-frame-wrap {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  min-height: 460px;
}
.demo-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #111;
}
.demo-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.demo-side h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #737373;
}
.demo-log {
  flex: 1;
  min-height: 160px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  color: #a3a3a3;
  font-size: 11.5px;
  line-height: 1.45;
}
.demo-css {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}
.demo-bridge {
  font-size: 12px;
  color: #737373;
  margin: 0 0 8px;
}
.demo-bridge.ready { color: #86efac; }
.demo-bridge.wait { color: #fcd34d; }
.demo-bridge.err { color: #fca5a5; }

.docs-body .demo-snippet-bar {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}

/* Unwrapped tables still scroll instead of stretching the page */
.docs-body > table,
.docs-body section > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  margin: 10px 0 20px;
}
.docs-body > table th,
.docs-body > table td,
.docs-body section > table th,
.docs-body section > table td {
  white-space: nowrap;
}
