.docs-header { position: sticky; top: 0; z-index: 20; }
.docs-links { display: flex; }
.docs-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(32px, 6vw, 78px); align-items: start; padding-block: 44px 110px; }
.docs-sidebar { position: sticky; top: 112px; min-width: 0; }
.docs-sidebar label { display: block; margin-bottom: 8px; color: #8197a9; font: 700 9px/1 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.docs-sidebar input { width: 100%; }
.docs-sidebar nav { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.docs-sidebar nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); color: #90a5b4; font-size: 11px; }
.docs-sidebar nav a:hover { color: var(--cyan); }
.docs-runtime { margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.docs-runtime span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); }
.docs-runtime b, .docs-runtime code { display: block; margin-top: 8px; font-size: 9px; overflow-wrap: anywhere; }
.docs-runtime b { color: var(--lime); }
.docs-runtime code { color: var(--muted); }
.docs-main { min-width: 0; }
.docs-hero { padding: 38px 0 70px; border-bottom: 1px solid var(--line); }
.docs-hero h1 { margin: 20px 0; font-size: clamp(40px, 6vw, 68px); letter-spacing: -.045em; }
.docs-hero > p:not(.terminal-label) { max-width: 780px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.docs-hero code, .docs-section code { color: #a9dce3; font-family: Consolas, monospace; }
.docs-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 27px; }
.docs-actions a { padding: 11px 14px; border: 1px solid var(--line-bright); border-radius: 7px; color: var(--text); font-size: 10px; }
.docs-actions a:first-child { color: var(--bg-deep); background: var(--cyan); }
.docs-section { padding: 70px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 92px; }
.docs-heading { display: flex; gap: 18px; align-items: start; margin-bottom: 28px; }
.docs-heading > span { flex: 0 0 auto; padding: 7px 8px; border: 1px solid var(--line-bright); border-radius: 5px; color: var(--cyan); font: 700 9px/1 Consolas, monospace; }
.docs-heading h2, .docs-heading p { margin: 0; }
.docs-heading h2 { font-size: clamp(25px, 4vw, 36px); }
.docs-heading p { margin-top: 7px; color: var(--muted); font-size: 11px; }
.quick-steps, .rule-list { display: grid; gap: 9px; padding: 0; list-style: none; }
.quick-steps { counter-reset: steps; }
.quick-steps li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.quick-steps b { color: var(--text); }
.quick-steps span, .rule-list li { color: var(--muted); font-size: 11px; line-height: 1.75; }
.contract-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contract-cards article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.contract-cards span { color: var(--cyan); font: 700 9px/1 Consolas, monospace; }
.contract-cards h3 { margin: 15px 0 8px; }
.contract-cards p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.callout { margin: 12px 0 0; padding: 16px 18px; border-left: 3px solid var(--amber); color: #c0cbd3; background: rgba(245,187,92,.06); font-size: 11px; line-height: 1.8; }
.pricing-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.pricing-strip div { min-width: 0; padding: 18px; background: var(--panel); }
.pricing-strip small, .pricing-strip strong { display: block; }
.pricing-strip small { color: var(--muted); font: 700 9px/1 Consolas, monospace; }
.pricing-strip strong { margin-top: 10px; font-size: 14px; }
.table-scroll { max-width: 100%; margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; background: var(--panel); }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; }
th { color: #8299aa; font: 700 9px/1 Consolas, monospace; text-transform: uppercase; }
td { color: #b7c6d0; }
td code { white-space: nowrap; }
.charge-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.charge-flow span { padding: 8px 10px; border: 1px solid var(--line-bright); border-radius: 6px; color: var(--lime); font: 700 10px/1 Consolas, monospace; }
.charge-flow b { color: var(--cyan); }
.charge-flow i { color: var(--muted); font-size: 10px; font-style: normal; }
.rule-list { margin-top: 14px; }
.rule-list li { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; }
.rule-list b { color: var(--text); }
.route-list { display: grid; gap: 9px; }
.route-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.route-card[hidden] { display: none; }
.route-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.method { padding: 6px 7px; border-radius: 5px; color: var(--bg-deep); background: var(--cyan); font: 800 9px/1 Consolas, monospace; }
.route-top code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-top span:last-child { color: var(--muted); font: 700 8px/1 Consolas, monospace; }
.route-card h3 { margin: 13px 0 5px; font-size: 14px; }
.route-card p { margin: 0; color: var(--muted); font-size: 10px; }
.route-purpose { margin-top: 10px !important; color: #c4d1d9 !important; font-size: 11px !important; line-height: 1.7; }
.route-when { margin-top: 6px !important; line-height: 1.7; }
.route-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.route-badges span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: #8da2b1; font: 700 8px/1 Consolas, monospace; }
.route-detail { margin-top: 15px; background: #08131f; }
.route-detail > summary { color: var(--cyan); }
.route-detail-content { display: grid; gap: 18px; padding: 18px; border-top: 1px solid var(--line); }
.route-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.route-fact-grid article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #0a1724; }
.route-fact-grid b { color: var(--cyan); font: 700 9px/1 Consolas, monospace; }
.route-fact-grid p { margin-top: 8px; line-height: 1.65; }
.route-contract-section { min-width: 0; }
.route-contract-section h4, .route-example h5 { margin: 0 0 10px; color: #d4e0e6; font-size: 12px; }
.route-muted { line-height: 1.7; }
.contract-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.contract-table-wrap table { min-width: 760px; }
.contract-table-wrap td { max-width: 390px; vertical-align: top; line-height: 1.6; overflow-wrap: anywhere; }
.contract-table-wrap code { white-space: normal; overflow-wrap: anywhere; }
.route-example { min-width: 0; }
.route-example pre { max-width: 100%; max-height: 360px; margin: 0; padding: 15px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; color: #b9d7df; background: #06101a; font: 10px/1.65 Consolas, monospace; }
.route-example code { white-space: pre-wrap; overflow-wrap: anywhere; }
.route-policies { padding: 15px; border-left: 3px solid var(--amber); background: rgba(245,187,92,.05); }
.route-policies p { margin-top: 8px; line-height: 1.7; }
details { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
summary { padding: 15px 18px; cursor: pointer; font-size: 11px; font-weight: 700; }
.code-block { position: relative; border-top: 1px solid var(--line); }
.code-block button { position: absolute; top: 10px; right: 10px; min-height: 31px; padding: 7px 10px; font-size: 9px; }
.code-block pre { max-width: 100%; margin: 0; padding: 54px 18px 20px; overflow-x: auto; color: #b9d7df; font: 10px/1.8 Consolas, monospace; }
.error-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.error-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.error-grid b { color: var(--amber); font: 700 13px/1 Consolas, monospace; }
.error-grid p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.docs-boundary p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.docs-boundary b { color: var(--amber); }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .docs-sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .docs-sidebar nav a { padding-inline: 8px; }
  .docs-runtime { display: none; }
  .contract-cards, .pricing-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .docs-links { display: none; }
  .docs-shell { padding-block: 25px 70px; }
  .docs-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-hero { padding-top: 28px; }
  .docs-section { padding-block: 55px; }
  .quick-steps li { grid-template-columns: 1fr; gap: 8px; }
  .contract-cards, .pricing-strip, .error-grid { grid-template-columns: 1fr; }
  .route-top { grid-template-columns: auto minmax(0, 1fr); }
  .route-top span:last-child { grid-column: 1 / -1; }
  .route-detail-content { padding: 13px; }
  .route-fact-grid { grid-template-columns: 1fr; }
}
