.docs-page {
  --docs-width: 1480px;
  --code: #17251d;
  background: #fbf7ed;
  font-size: 16px;
}

.docs-page::before {
  opacity: 0.16;
}

.docs-header {
  position: relative;
  width: min(var(--docs-width), calc(100% - 32px));
  max-width: none;
  margin-top: 10px;
  border-radius: 13px 13px 0 0;
  box-shadow: none;
}

.docs-product {
  padding-left: 16px;
  margin-right: auto;
  margin-left: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-left: 1px solid var(--line);
}

.docs-version-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--docs-width), calc(100% - 32px));
  min-height: 42px;
  padding: 7px 20px;
  margin: 0 auto;
  color: #dfeadc;
  background: var(--ink);
  border-radius: 0 0 13px 13px;
}

.docs-version-bar div {
  display: flex;
  gap: 11px;
  align-items: center;
  font-size: 0.76rem;
}

.docs-version-bar strong {
  color: white;
  letter-spacing: 0.04em;
}

.docs-version-bar a {
  color: white;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.version-dot {
  width: 8px;
  height: 8px;
  background: #c8e57f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(200, 229, 127, 0.15);
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 900px) 170px;
  gap: clamp(28px, 4vw, 64px);
  justify-content: center;
  width: min(var(--docs-width), calc(100% - 32px));
  margin: 0 auto;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  scrollbar-width: thin;
}

.docs-sidebar {
  padding: 42px 0 40px;
}

.docs-search {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.docs-search:focus-within {
  border-color: var(--grass-dark);
  box-shadow: 0 0 0 3px rgba(65, 103, 47, 0.12);
}

.docs-search svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.docs-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.docs-search input::placeholder {
  color: #7d887e;
}

.docs-search kbd {
  min-width: 21px;
  color: var(--muted);
  font: 700 0.7rem "Cascadia Code", monospace;
  text-align: center;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.docs-nav {
  margin-top: 28px;
}

.docs-nav div + div {
  margin-top: 25px;
}

.docs-nav p,
.docs-toc p {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-nav a,
.docs-toc a,
.sidebar-links a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
}

.docs-nav a:hover,
.docs-toc a:hover,
.sidebar-links a:hover,
.docs-nav a[aria-current="location"],
.docs-toc a[aria-current="location"] {
  color: var(--grass-dark);
}

.docs-nav a[aria-current="location"] {
  padding-left: 9px;
  margin-left: -12px;
  border-left: 3px solid var(--grass);
}

.sidebar-links {
  padding-top: 20px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.docs-content {
  min-width: 0;
  padding: 52px 0 80px;
}

.docs-section {
  position: relative;
  padding-top: 32px;
  margin-bottom: 84px;
  scroll-margin-top: 20px;
}

.docs-section[hidden] {
  display: none;
}

.docs-hero {
  padding: 4px 0 72px;
  margin-bottom: 72px;
  border-bottom: 1px solid var(--line);
}

.docs-breadcrumb {
  display: flex;
  gap: 9px;
  margin-bottom: 46px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.docs-breadcrumb a {
  color: var(--grass-dark);
  text-decoration: none;
}

.docs-eyebrow,
.section-marker {
  color: var(--grass-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.docs-hero h1 {
  max-width: 760px;
  margin: 10px 0 22px;
  font-size: clamp(3.25rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.docs-lede {
  max-width: 730px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.docs-hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.docs-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 55px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 6px 0 var(--ink);
}

.docs-summary-grid article {
  display: grid;
  gap: 1px;
  padding: 19px 21px;
  border-right: 1px solid var(--line);
}

.docs-summary-grid article:last-child {
  border-right: 0;
}

.docs-summary-grid small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.docs-summary-grid strong {
  font: 800 1.45rem Georgia, serif;
}

.docs-summary-grid span {
  color: var(--muted);
  font-size: 0.76rem;
}

.section-marker {
  display: inline-block;
  min-width: 35px;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--grass);
}

.docs-section h2 {
  margin: 14px 0 18px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.docs-section h3 {
  margin: 30px 0 12px;
  font-size: 1.2rem;
}

.docs-section > p {
  max-width: 760px;
  color: var(--muted);
}

.docs-section code:not(pre code) {
  padding: 0.12em 0.35em;
  color: #314a28;
  font-size: 0.86em;
  background: #e8efd6;
  border: 1px solid rgba(65, 103, 47, 0.14);
  border-radius: 4px;
}

.callout {
  padding: 20px 22px;
  margin: 28px 0;
  background: var(--sky-light);
  border: 1px solid #7bb3c1;
  border-left: 5px solid #4b91a4;
  border-radius: 9px;
}

.callout strong {
  font: 800 1.05rem Georgia, serif;
}

.callout p {
  margin: 5px 0 0;
  color: var(--muted);
}

.callout-warning {
  background: #fff4ce;
  border-color: #cfad51;
  border-left-color: #b17d1d;
}

.callout-neutral {
  background: white;
  border-color: var(--line);
  border-left-color: var(--dirt);
}

.status-table {
  margin-top: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.status-row {
  display: grid;
  grid-template-columns: 140px 110px 1fr;
  gap: 18px;
  align-items: start;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row strong,
.status-head {
  color: var(--ink);
}

.status-head {
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper-deep);
}

.api-status {
  width: fit-content;
  padding: 3px 8px;
  font-size: 0.66rem;
  font-weight: 850;
  border: 1px solid;
  border-radius: 999px;
}

.api-status.ready {
  color: #325225;
  background: #e7f2ce;
  border-color: #9fbd67;
}

.api-status.building {
  color: #7a5717;
  background: #fff3c8;
  border-color: #d6ad48;
}

.api-status.planned {
  color: #566057;
  background: #f0f0e9;
  border-color: #babdb4;
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(7, auto);
  gap: 10px;
  align-items: center;
  margin: 32px 0;
}

.flow-diagram article {
  display: grid;
  min-height: 112px;
  padding: 15px;
  background: white;
  border: 1px solid var(--ink);
  border-radius: 8px;
}

.flow-diagram small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-diagram strong {
  align-self: end;
  font: 800 1rem Georgia, serif;
}

.flow-diagram span {
  color: var(--muted);
  font-size: 0.68rem;
}

.flow-diagram i,
.sequence i {
  color: var(--grass-dark);
  font-style: normal;
  font-weight: 900;
}

.check-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 30px 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
}

.check-list li::before {
  position: absolute;
  top: 0.42em;
  left: 1px;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--grass);
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 var(--ink);
}

.check-list strong {
  color: var(--ink);
}

.check-list.compact {
  gap: 10px;
}

.code-panel {
  margin: 28px 0;
  overflow: hidden;
  color: #e7eee7;
  background: var(--code);
  border: 1px solid #0a120d;
  border-radius: 10px;
  box-shadow: 4px 5px 0 #b9b09b;
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 5px 10px 5px 17px;
  color: #aab7ab;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.code-panel pre {
  padding: 21px;
  margin: 0;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.7;
  tab-size: 4;
}

.copy-button {
  padding: 5px 10px;
  color: #dbe5da;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

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

.tree-panel pre {
  color: #cfdf9b;
}

.reference-table,
.field-table {
  margin-top: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reference-table > div {
  display: grid;
  grid-template-columns: 160px 1fr 74px;
  gap: 16px;
  align-items: start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.reference-table > div:last-child,
.field-table > div:last-child {
  border-bottom: 0;
}

.reference-table span,
.field-table span {
  color: var(--muted);
  font-size: 0.82rem;
}

.reference-table b {
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
  text-transform: uppercase;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 30px 0;
}

.concept-grid article {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.concept-grid span {
  color: var(--grass-dark);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.concept-grid h3 {
  margin: 8px 0;
  font-size: 1.12rem;
}

.concept-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-note {
  font-size: 0.77rem;
}

.source-note a,
.symbol-list a {
  color: var(--grass-dark);
  font-weight: 750;
}

.field-table > div {
  display: grid;
  grid-template-columns: 60px 75px 1fr;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.field-table .field-head {
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper-deep);
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 25px;
}

.token-list code {
  padding: 5px 9px;
  color: #314a28;
  font-size: 0.76rem;
  background: #e8efd6;
  border: 1px solid #b7c99a;
  border-radius: 5px;
}

.sequence {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
  margin: 30px 0;
  font-size: 0.78rem;
  font-weight: 800;
  background: white;
  border: 1px solid var(--ink);
  border-radius: 9px;
}

.lifecycle-list {
  padding: 0;
  margin: 30px 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.lifecycle-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.lifecycle-list li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  font: 800 0.85rem Georgia, serif;
  background: var(--sky);
  border: 1px solid var(--ink);
  border-radius: 8px;
}

.lifecycle-list p {
  margin: 2px 0 0;
  color: var(--muted);
}

.api-reference {
  padding: 36px;
  background: #f2ead9;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.symbol-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.symbol-list article {
  min-width: 0;
  padding: 19px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.symbol-list h3 {
  margin: 0 0 9px;
  font-size: 0.95rem;
}

.symbol-list p,
.symbol-list a {
  font-size: 0.78rem;
}

.symbol-list p {
  margin: 0 0 9px;
  color: var(--muted);
}

.symbol-list pre {
  margin: 0;
  overflow: auto;
  font-size: 0.73rem;
  line-height: 1.6;
}

.limits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.limits-grid article {
  display: grid;
  gap: 3px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.limits-grid strong {
  color: var(--grass-dark);
  font: 800 1.45rem Georgia, serif;
}

.limits-grid span {
  color: var(--muted);
  font-size: 0.76rem;
}

.docs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  color: white;
  background: var(--ink);
  border-radius: 12px;
}

.docs-footer strong {
  font: 800 1.2rem Georgia, serif;
}

.docs-footer p {
  margin: 2px 0 0;
  color: #b9c7ba;
  font-size: 0.78rem;
}

.docs-footer .button-primary {
  color: var(--ink);
  white-space: nowrap;
  background: var(--sky);
}

.no-results {
  padding: 50px 25px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.no-results p {
  margin: 4px 0 0;
  color: var(--muted);
}

.docs-toc {
  padding-top: 52px;
}

.docs-toc a {
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--line);
}

.docs-toc a[aria-current="location"] {
  border-left: 2px solid var(--grass);
}

.toc-rule {
  display: block;
  width: 45px;
  margin: 14px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: 220px minmax(0, 850px);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-product {
    margin-right: 48px;
  }

  .docs-layout {
    display: block;
    width: min(100% - 32px, 850px);
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    padding: 28px 0 0;
    overflow: visible;
  }

  .docs-nav,
  .sidebar-links {
    display: none;
  }

  .docs-content {
    padding-top: 35px;
  }

  .docs-breadcrumb {
    margin-bottom: 32px;
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-diagram i {
    text-align: center;
    transform: rotate(90deg);
  }

  .flow-diagram article {
    min-height: 88px;
  }
}

@media (max-width: 620px) {
  .docs-page {
    font-size: 15px;
  }

  .docs-header,
  .docs-version-bar {
    width: calc(100% - 16px);
  }

  .docs-product {
    display: none;
  }

  .docs-version-bar {
    padding-inline: 12px;
  }

  .docs-version-bar div span:last-child,
  .docs-version-bar > a span {
    display: none;
  }

  .docs-layout {
    width: calc(100% - 26px);
  }

  .docs-section {
    margin-bottom: 60px;
  }

  .docs-hero {
    padding-bottom: 55px;
    margin-bottom: 55px;
  }

  .docs-hero h1 {
    font-size: clamp(2.65rem, 12.5vw, 3.5rem);
  }

  .docs-hero-actions,
  .docs-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .docs-hero-actions .button,
  .docs-footer .button {
    text-align: center;
  }

  .docs-summary-grid,
  .concept-grid,
  .symbol-list,
  .limits-grid {
    grid-template-columns: 1fr;
  }

  .docs-summary-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .docs-summary-grid article:last-child {
    border-bottom: 0;
  }

  .status-row,
  .reference-table > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .status-head {
    display: none;
  }

  .reference-table b {
    text-align: left;
  }

  .field-table > div {
    grid-template-columns: 45px 60px 1fr;
    gap: 8px;
    padding-inline: 10px;
  }

  .code-panel pre {
    padding: 17px;
    font-size: 0.72rem;
  }

  .sequence {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .sequence i {
    transform: rotate(90deg);
  }

  .api-reference {
    padding: 24px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-page * {
    scroll-behavior: auto;
  }
}
