:root {
  --docs-accent: #d97757;
  --docs-accent-strong: #bd5b38;
  --docs-ink: #1a1915;
  --docs-muted: #6f6962;
  --docs-line: rgba(113, 91, 76, 0.14);
  --docs-card: rgba(255, 255, 255, 0.76);
  --docs-soft: rgba(255, 248, 243, 0.82);
}

.dark {
  --docs-ink: #f6f2ec;
  --docs-muted: #b9b2aa;
  --docs-line: rgba(255, 255, 255, 0.09);
  --docs-card: rgba(31, 32, 36, 0.82);
  --docs-soft: rgba(217, 119, 87, 0.09);
}

.docs-nav-link {
  color: #5f5952;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.dark .docs-nav-link { color: #d3cec7; }
.docs-nav-link:hover,
.docs-nav-link[aria-current="page"] { color: var(--docs-accent); }

.doc-wrap {
  max-width: 82rem;
  gap: 2.25rem;
  padding: 0 1.5rem;
}

.doc-side {
  width: 15.5rem;
  top: 4.75rem;
  max-height: calc(100vh - 4.75rem);
  padding: 1.5rem 0.65rem 4rem 0;
  border-right: 1px solid var(--docs-line);
  scrollbar-gutter: stable;
}

.doc-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 0.85rem;
}

.doc-side-label {
  color: var(--docs-ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.doc-side-close {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--docs-line);
  border-radius: 0.7rem;
  color: var(--docs-muted);
  background: transparent;
}

.doc-group { margin: 0 0 0.35rem; }

.doc-grouptitle {
  padding: 0.55rem 0.75rem;
  color: #8b8178;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.doc-sidelink {
  position: relative;
  margin: 2px 0;
  padding: 0.52rem 0.75rem 0.52rem 1rem;
  color: #575149;
  font-size: 0.875rem;
  line-height: 1.35;
}

.dark .doc-sidelink { color: #cbc5be; }

.doc-sidelink.active {
  color: #9b442a;
  background: linear-gradient(90deg, rgba(217, 119, 87, 0.16), rgba(217, 119, 87, 0.05));
  box-shadow: inset 3px 0 0 var(--docs-accent);
}

.dark .doc-sidelink.active {
  color: #ffc3a7;
  background: linear-gradient(90deg, rgba(217, 119, 87, 0.2), rgba(217, 119, 87, 0.06));
}

.doc-content {
  width: min(100%, 58rem);
  max-width: 58rem;
  padding: 2.35rem 0 6rem;
}

.doc-content h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.doc-content h2 {
  margin: 2.4rem 0 0.85rem;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.doc-content h3 { text-transform: none; }

.doc-lead {
  max-width: 48rem;
  font-size: 1.04rem;
  line-height: 1.8;
}

.doc-bc {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.doc-home-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.7rem);
  border: 1px solid var(--docs-line);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 88% 10%, rgba(217, 119, 87, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 246, 239, 0.82));
  box-shadow: 0 24px 65px -48px rgba(80, 44, 27, 0.7);
}

.dark .doc-home-hero {
  background:
    radial-gradient(circle at 88% 10%, rgba(217, 119, 87, 0.19), transparent 35%),
    linear-gradient(135deg, rgba(34, 32, 30, 0.97), rgba(27, 26, 26, 0.94));
}

.doc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--docs-accent-strong);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.doc-eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
}

.doc-hero-actions,
.doc-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.doc-action {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.05rem;
  border: 1px solid var(--docs-line);
  border-radius: 0.75rem;
  color: var(--docs-ink);
  background: var(--docs-card);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-action:hover {
  border-color: rgba(217, 119, 87, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -18px rgba(80, 44, 27, 0.8);
}

.doc-action.primary {
  border-color: var(--docs-accent);
  color: white;
  background: var(--docs-accent);
}

.doc-action.primary:hover { background: var(--docs-accent-strong); }

.doc-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}

.doc-section-head h2 { margin: 0; }
.doc-section-head p { margin: 0.35rem 0 0; color: var(--docs-muted); }

.doc-protocol-grid,
.doc-tool-grid,
.doc-step-grid,
.doc-link-grid {
  display: grid;
  gap: 0.9rem;
}

.doc-protocol-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.doc-info-card,
.doc-tool-card,
.doc-step-card,
.doc-link-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--docs-line);
  border-radius: 1rem;
  background: var(--docs-card);
}

.doc-info-card,
.doc-step-card { padding: 1.15rem; }

.doc-info-card h3,
.doc-step-card h3,
.doc-link-card h3 {
  margin: 0;
  color: var(--docs-ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.doc-info-card p,
.doc-step-card p,
.doc-link-card p {
  margin: 0.5rem 0 0;
  color: var(--docs-muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

.doc-info-card code {
  display: block;
  margin-top: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--docs-line);
  background: rgba(217, 119, 87, 0.07);
  word-break: break-all;
}

.doc-card-tag {
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  color: var(--docs-accent-strong);
  background: rgba(217, 119, 87, 0.12);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.doc-step-number {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  border-radius: 0.65rem;
  color: white;
  background: var(--docs-accent);
  font-size: 0.8rem;
  font-weight: 800;
}

.doc-tool-card,
.doc-link-card {
  display: block;
  padding: 1.05rem 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-tool-card:hover,
.doc-link-card:hover {
  border-color: rgba(217, 119, 87, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 16px 35px -28px rgba(72, 39, 24, 0.85);
}

.doc-tool-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--docs-ink);
  font-weight: 750;
}

.doc-tool-title span:last-child { color: var(--docs-accent); }

.doc-tool-card p { margin: 0.4rem 0 0; color: var(--docs-muted); font-size: 0.84rem; }

.doc-help-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 0.9rem;
  margin-top: 2.5rem;
}

.doc-help-card {
  padding: 1.2rem;
  border: 1px solid var(--docs-line);
  border-radius: 1rem;
  background: var(--docs-soft);
}

.doc-help-card h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.doc-issue-list { display: grid; gap: 0.5rem; }
.doc-issue-list a { color: var(--docs-ink); font-size: 0.875rem; text-decoration: none; }
.doc-issue-list a:hover { color: var(--docs-accent); }

.doc-live-note {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 0.9rem;
  color: #145a3d;
  background: rgba(240, 253, 248, 0.86);
}

.dark .doc-live-note {
  color: #b5f5e4;
  background: rgba(20, 184, 166, 0.09);
}

.doc-tabs {
  margin: 1.2rem 0;
  border: 1px solid var(--docs-line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--docs-card);
}

.doc-tab-list {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--docs-line);
}

.doc-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 0.65rem;
  color: var(--docs-muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.doc-tab[aria-selected="true"] { color: white; background: var(--docs-accent); }
.doc-tab-panel { padding: 0.3rem 1rem 1rem; }
.doc-tab-panel[hidden] { display: none; }

.doc-pre { position: relative; padding-top: 2.5rem; }

.doc-copy-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.45rem;
  color: #f4eee8;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  cursor: pointer;
}

.doc-copy-button:hover { background: rgba(255, 255, 255, 0.16); }

.doc-footer-v2 { border-top: 1px solid var(--docs-line); }
.doc-footer-v2 a { text-decoration: none; }

.doc-side-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 14, 13, 0.46);
  backdrop-filter: blur(2px);
}

.doc-side-overlay.open { display: block; }

.doc-side-toggle {
  gap: 0.4rem;
  min-height: 2.65rem;
  padding: 0.65rem 0.95rem;
}

@media (max-width: 1000px) {
  .doc-wrap { gap: 1.4rem; }
  .doc-side { width: 14rem; }
}

@media (max-width: 900px) {
  .doc-wrap { display: block; padding: 0 1rem; }
  .doc-content { width: 100%; max-width: none; padding-top: 1.4rem; }
  .doc-side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(20rem, 86vw);
    max-height: none;
    padding: 1rem 0.75rem 4rem;
    border-right: 1px solid var(--docs-line);
    background: #faf6f1;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.18);
  }
  .dark .doc-side { background: #1a1a1a; }
  .doc-side.open { transform: translateX(0); }
  .doc-side-close { display: inline-flex; }
  .doc-protocol-grid,
  .doc-step-grid { grid-template-columns: 1fr; }
  .doc-help-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .doc-home-hero { padding: 1.35rem; border-radius: 1rem; }
  .doc-content h1 { font-size: 2rem; }
  .doc-tool-grid,
  .doc-link-grid { grid-template-columns: 1fr; }
  .doc-section-head { align-items: flex-start; flex-direction: column; }
  .doc-hero-actions .doc-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-action,
  .doc-tool-card,
  .doc-link-card,
  .doc-side { transition: none !important; }
}
