.docs-page .top,
.docs-page footer {
  width: min(1180px, calc(100% - 40px));
}

.docs-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 176px;
  gap: 28px;
  align-items: start;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.docs-sidebar {
  padding: 4px 0 20px;
}
.docs-sidebar b {
  display: block;
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.docs-sidebar b:first-child { margin-top: 0; }
.docs-sidebar a {
  display: block;
  padding: 6px 10px;
  color: var(--nav);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
}
.docs-sidebar a:hover { background: rgba(255,255,255,.55); color: var(--text); }
.docs-sidebar a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.docs-main {
  min-width: 0;
  overflow: hidden;
  padding: 28px 32px 40px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(40, 55, 80, 0.06);
}

.doc-page { display: none; }
.doc-page.is-active { display: block; }

.docs-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.docs-main h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.03em;
}
.docs-lead {
  max-width: 42em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.docs-main h2 {
  margin: 32px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  scroll-margin-top: 88px;
}
.docs-main h3 {
  margin: 20px 0 0;
  font-size: 16px;
}
.docs-main p,
.docs-main li {
  color: var(--nav);
  font-size: 15px;
}
.docs-main > .doc-page > p,
.docs-main .doc-block > p {
  margin: 10px 0 0;
}
.docs-main ul,
.docs-main ol { margin: 8px 0 0; padding-left: 1.2em; }
.docs-main li + li { margin-top: 6px; }
.docs-main a { color: var(--accent); font-weight: 600; }
.docs-main a:hover { text-decoration: underline; }
.docs-main a.btn,
.docs-main a.btn:hover {
  color: #fff;
  text-decoration: none;
}
.docs-main a.btn-secondary,
.docs-main a.btn-secondary:hover {
  color: var(--text);
}

.docs-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.doc-paths {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.doc-path {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid rgba(28, 28, 30, 0.07);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(40, 55, 80, 0.05);
}
.doc-path.is-lead {
  border-color: color-mix(in srgb, var(--accent) 32%, white);
  background: linear-gradient(180deg, var(--accent-soft), #fff);
}
.doc-path b {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.doc-path span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.doc-path a {
  margin-top: 6px;
  font-size: 13px;
}

.doc-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #5856d6);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}

.doc-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, white);
  border-radius: 12px;
  font-size: 14px;
}
.doc-warn {
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.28);
}

.doc-steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.doc-steps:has(> :nth-child(4)) {
  grid-template-columns: 1fr 1fr;
}
.doc-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100%;
  padding: 16px 16px 18px;
  background: #fff;
  border: 1px solid rgba(28, 28, 30, 0.07);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(40, 55, 80, 0.05);
}
.doc-steps li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, white));
  border-radius: 0 0 3px 3px;
}
.doc-steps em {
  width: 28px;
  height: 28px;
  margin-top: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 32%, transparent);
}
.doc-steps b {
  display: block;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.02em;
}
.doc-steps li div {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.doc-figure {
  margin: 20px -32px 0;
}
.doc-shot {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  background: #e8edf5;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.doc-figure figcaption {
  margin: 8px 32px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.doc-figure .doc-mock,
.docs-page .ss-mockup {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.docs-page .ss-mockup {
  padding: 22px 28px 24px;
  font-size: 13px;
}

.doc-mock {
  overflow: hidden;
  background: #e8edf5;
  border: 1px solid rgba(28,28,30,.08);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(40, 55, 80, 0.08);
}
.doc-mock-bar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #dfe5ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.doc-mock-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9ced8;
}
.doc-mock-bar i:first-child { background: #ff5f57; }
.doc-mock-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 220px;
  background: radial-gradient(120% 80% at 10% 10%, #f4f7fc 0%, #e6ecf6 100%);
}
.doc-mock-nav {
  padding: 12px 8px;
  display: grid;
  align-content: start;
  gap: 4px;
  background: rgba(255,255,255,.45);
  border-right: 1px solid rgba(28,28,30,.06);
}
.doc-mock-nav span {
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  color: var(--nav);
  font-size: 12px;
  font-weight: 600;
}
.doc-mock-nav span.on {
  color: #fff;
  background: var(--accent);
}
.doc-mock-panel { padding: 14px 14px 16px; }
.doc-mock-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.doc-mock-title b { font-size: 14px; }
.doc-mock-title small { color: var(--muted); font-size: 11px; }
.doc-mock-btn {
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.doc-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.doc-card {
  padding: 10px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(28,28,30,.06);
  border-radius: 10px;
}
.doc-card em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.doc-card b { font-size: 16px; }
.doc-card small { color: var(--faint); font-size: 10px; }
.doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,.78);
  border-radius: 8px;
  font-size: 12px;
}
.doc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.doc-chip {
  margin-left: auto;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
}

.doc-callouts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.doc-callouts span {
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px dashed var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.doc-drop {
  min-height: 220px;
  padding: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(238,244,255,.85), rgba(232,237,245,.92));
}
.doc-drop-card {
  width: min(360px, 100%);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255,255,255,.92);
  border: 2px dashed color-mix(in srgb, var(--accent) 48%, white);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(35, 72, 128, 0.12);
}
.doc-drop-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.doc-drop-card b {
  font-size: 15px;
  color: var(--text);
}
.doc-drop-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.doc-drop-card .doc-callouts { justify-content: center; }

.docs-toc b {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.docs-toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.docs-toc a:hover,
.docs-toc a.is-active {
  color: var(--accent);
  font-weight: 600;
}

.docs-pager {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(28,28,30,.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.docs-pager a {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.doc-demo {
  margin-top: 16px;
}
.doc-demo .stage { width: 100%; }

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }
  .docs-sidebar,
  .docs-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .docs-toc { order: -1; }
  .docs-toc nav,
  .docs-sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .docs-sidebar b { width: 100%; margin-top: 10px; }
  .docs-sidebar a,
  .docs-toc a {
    padding: 4px 10px;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(28,28,30,.08);
    border-radius: 999px;
    font-size: 12px;
  }
  .docs-main { padding: 20px 16px 28px; }
  .doc-figure { margin-left: -16px; margin-right: -16px; }
  .doc-figure figcaption { margin-left: 16px; margin-right: 16px; }
  .doc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-paths { grid-template-columns: 1fr; }
  .doc-mock-body { grid-template-columns: 1fr; }
  .doc-mock-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); border-right: 0; }
}

@media (max-width: 640px) {
  .doc-steps,
  .doc-steps:has(> :nth-child(4)) {
    grid-template-columns: 1fr;
  }
}
