.docs-page {
  background: var(--paper);
  overflow-x: hidden;
}

.docs-header .nav-shell {
  width: 100%;
  padding-right: max(24px, calc((100vw - 1360px) / 2 + 24px));
  padding-left: max(24px, calc((100vw - 1360px) / 2 + 24px));
}

.docs-version-mobile {
  display: none;
}

.docs-version-menu > summary {
  min-width: 58px;
  height: 36px;
  padding: 0 9px;
  justify-content: center;
  border-radius: var(--radius-control);
}

.docs-version-menu > summary:hover,
.docs-version-menu[open] > summary {
  background: var(--paper-blue);
}

.docs-version-menu .nav-dropdown-panel {
  right: 0;
  left: auto;
  min-width: 124px;
  transform: none;
}

.docs-main {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  padding: 42px 0 104px;
}

.docs-layout {
  display: grid;
  align-items: start;
  gap: clamp(28px, 3vw, 48px);
  grid-template-columns: 220px minmax(0, 860px) minmax(150px, 1fr);
}

.docs-sidebar,
.docs-on-page {
  position: sticky;
  top: calc(var(--header) + 28px);
}

.docs-sidebar {
  max-height: calc(100vh - var(--header) - 48px);
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 36px rgba(36, 76, 137, 0.07);
  overflow: auto;
  scrollbar-width: thin;
}

.docs-sidebar > p,
.docs-on-page > p {
  margin: 0 10px 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.12em;
}

.docs-sidebar nav,
.docs-on-page nav {
  display: grid;
  gap: 3px;
}

.docs-sidebar a,
.docs-on-page a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 570;
  transition: color 160ms ease, background 160ms ease;
}

.docs-sidebar a:hover,
.docs-sidebar a.is-active,
.docs-on-page a:hover,
.docs-on-page a.is-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.docs-sidebar .docs-group {
  margin-top: 20px;
  padding: 0 10px 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.docs-on-page {
  padding-top: 14px;
}

.docs-on-page a {
  position: relative;
  padding: 6px 10px 6px 12px;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  font-size: 11px;
}

.docs-on-page a.is-active {
  border-left-color: var(--blue);
}

.docs-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.docs-hero {
  position: relative;
  padding: clamp(34px, 5vw, 58px);
  border: 1px solid #d2e1f5;
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 88% 8%, rgba(18, 100, 255, 0.16), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.docs-hero::after {
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(18, 100, 255, 0.12);
  border-radius: 50%;
  box-shadow: inset 0 0 0 42px rgba(255, 255, 255, 0.26);
  content: "";
  pointer-events: none;
}

.docs-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0;
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1;
  overflow-wrap: normal;
  word-break: keep-all;
}

.docs-hero > p:not(.docs-kicker) {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.docs-meta {
  position: relative;
  z-index: 1;
  display: flex;
  margin-top: 28px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  gap: 10px 20px;
  flex-wrap: wrap;
}

.docs-channel {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 700px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(18, 100, 255, 0.18);
  align-items: start;
  grid-template-columns: 28px 1fr;
  gap: 12px;
}

.docs-channel .ui-icon {
  width: 24px;
  height: 24px;
  color: var(--green);
}

.docs-channel strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
}

.docs-channel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.docs-channel.is-next .ui-icon {
  color: #6c55b7;
}

.docs-version-list {
  max-width: 760px;
  margin: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.docs-version-list > div {
  display: grid;
  padding: 20px 0;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  gap: 26px;
}

.docs-version-list > div + div {
  border-top: 1px solid var(--line);
}

.docs-version-list dt {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 12px;
}

.docs-version-list dt > strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.docs-version-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.doc-version-contract {
  padding: 16px 18px;
  border: 1px solid #cbdcf4;
  border-radius: 12px;
  background: var(--paper-blue);
}

.docs-maturity {
  max-width: 760px;
  margin: 26px 0 8px;
  padding: 20px 22px;
  border: 1px solid #cbdcf4;
  border-radius: 12px;
  background: var(--paper-blue);
}

.docs-maturity strong {
  color: var(--blue-deep);
  font-size: 14px;
}

.docs-maturity p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.doc-section {
  min-width: 0;
  padding: 58px 4px 22px;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section h2 {
  max-width: 760px;
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.doc-section h3 {
  margin: 42px 0 14px;
  color: var(--text);
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.doc-section h4 {
  margin: 27px 0 10px;
  color: var(--text-soft);
  font-size: 15px;
}

.doc-section > p,
.doc-section > .lang,
.doc-copy {
  max-width: 760px;
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.82;
}

.doc-section a:not(.doc-button) {
  color: var(--blue-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(18, 100, 255, 0.28);
  text-underline-offset: 3px;
}

.doc-grid {
  display: grid;
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  gap: 1px;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}

.doc-card {
  min-height: 150px;
  padding: 24px;
  background: #ffffff;
}

.doc-card:last-child:nth-child(odd) {
  min-height: 126px;
  grid-column: 1 / -1;
}

.doc-card small {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.doc-card h3 {
  margin: 12px 0 9px;
  font-size: 18px;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.doc-code {
  position: relative;
  margin: 22px 0 28px;
  border: 1px solid #263754;
  border-radius: 14px;
  background: #0b1730;
  box-shadow: 0 18px 44px rgba(14, 27, 53, 0.14);
  overflow: hidden;
}

.doc-code > header {
  display: flex;
  min-height: 44px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #111f3a;
  align-items: center;
  justify-content: space-between;
}

.doc-code > header code {
  color: #aebbd0;
  font-size: 10px;
}

.doc-code button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd6e8;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.doc-code button:hover {
  border-color: #78a9ff;
  color: #ffffff;
}

.doc-code pre {
  margin: 0;
  padding: 22px;
  color: #d7e1ef;
  font-size: 12px;
  line-height: 1.72;
  overflow: auto;
  tab-size: 2;
}

.doc-code .token-keyword { color: #78a9ff; }
.doc-code .token-string { color: #7dd7bc; }
.doc-code .token-comment { color: #7f8da3; }

.doc-callout {
  margin: 26px 0;
  padding: 19px 21px;
  border: 1px solid #c9dcf8;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.75;
}

.doc-callout strong {
  color: var(--text);
}

.doc-callout.is-warning {
  border-color: #eadab9;
  background: #fff8e9;
}

.doc-steps {
  display: grid;
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  gap: 1px;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
}

.doc-steps div {
  position: relative;
  min-height: 112px;
  padding: 20px 16px;
  background: #ffffff;
}

.doc-steps div:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 43px;
  right: -8px;
  color: var(--blue);
  content: "→";
  font-family: var(--mono);
}

.doc-steps small {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 720;
}

.doc-steps b {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.doc-table-wrap {
  margin: 24px 0 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(36, 76, 137, 0.06);
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.doc-table th,
.doc-table td {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-table tr:last-child th,
.doc-table tr:last-child td {
  border-bottom: 0;
}

.doc-table th:last-child,
.doc-table td:last-child {
  border-right: 0;
}

.doc-table thead th {
  background: #f3f7fc;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.doc-table tbody th {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
}

.doc-table td {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.doc-table code {
  color: var(--blue-deep);
  font-size: 0.94em;
}

.doc-feature-table { min-width: 820px; }
.doc-feature-table th:first-child { width: 23%; }
.doc-feature-table th:nth-child(2) { width: 19%; }

.doc-status {
  display: inline-flex;
  color: var(--blue);
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-status.is-available { color: var(--green); }
.doc-status.is-foundation { color: var(--blue); }
.doc-status.is-experimental { color: #a46000; }
.doc-status.is-planned { color: #6c55b7; }
.doc-status.is-contract { color: #276eaa; }
.doc-status.is-unavailable { color: var(--faint); }

.doc-protocol-matrix { min-width: 1080px; }
.doc-protocol-matrix th:first-child { width: 22%; }
.doc-protocol-matrix th:nth-child(2) { width: 13%; }
.doc-protocol-matrix th:nth-child(3),
.doc-protocol-matrix th:nth-child(4) { width: 25%; }
.doc-protocol-matrix th:last-child { width: 15%; }
.doc-protocol-matrix tbody th strong,
.doc-protocol-matrix tbody th small,
.doc-protocol-matrix .matrix-value strong,
.doc-protocol-matrix .matrix-value small { display: block; }
.doc-protocol-matrix tbody th small,
.doc-protocol-matrix .matrix-value small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
.doc-protocol-matrix .matrix-value strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
}
.doc-protocol-matrix tr[data-measured="false"] td,
.doc-protocol-matrix tr[data-measured="false"] th { opacity: 0.7; }

.doc-table-wrap[tabindex]:focus-visible {
  outline: 3px solid rgba(18, 100, 255, 0.28);
  outline-offset: 3px;
}

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

.doc-verdict {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(36, 76, 137, 0.06);
}

.doc-verdict small {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.doc-verdict.good small { color: var(--green); }
.doc-verdict.bad small { color: var(--red); }
.doc-verdict.open small { color: #a46000; }
.doc-verdict h3 { margin: 11px 0 8px; font-size: 17px; }
.doc-verdict p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.doc-list {
  margin: 18px 0 26px;
  padding: 0;
  list-style: none;
}

.doc-list li {
  position: relative;
  margin: 9px 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.doc-list li::before {
  position: absolute;
  top: 9px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
  content: "";
}

.docs-footer {
  margin-top: 70px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .docs-layout {
    gap: 34px;
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .docs-on-page {
    display: none;
  }
}

@media (max-width: 820px) {
  .docs-main {
    width: calc(100% - 28px);
    max-width: 860px;
    padding-top: 28px;
  }

  .docs-header .nav-shell {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .docs-version-menu {
    display: none;
  }

  .docs-version-mobile {
    display: block;
  }

  .docs-layout {
    display: block;
  }

  .docs-sidebar {
    position: static;
    display: none;
  }

  .docs-hero {
    padding: 34px 28px;
  }

  .docs-hero h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .doc-steps {
    grid-template-columns: 1fr;
  }

  .doc-steps div {
    min-height: 80px;
  }

  .doc-steps div:not(:last-child)::after {
    top: auto;
    right: 22px;
    bottom: -13px;
    transform: rotate(90deg);
  }
}

@media (max-width: 600px) {
  .docs-header .brand > span {
    display: none;
  }

  .docs-hero {
    padding: 30px 22px;
  }

  .docs-hero::after {
    display: none;
  }

  .docs-meta {
    display: grid;
  }

  .docs-version-list > div {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .doc-section {
    padding-top: 48px;
  }

  .doc-grid,
  .doc-verdict-grid {
    grid-template-columns: 1fr;
  }

  .doc-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .doc-code pre {
    padding: 18px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar a,
  .docs-on-page a {
    transition: none;
  }
}
