:root {
  --doc-bg: #f6f5ef;
  --doc-surface: #ffffff;
  --doc-surface-soft: #fbfaf5;
  --doc-text: #181817;
  --doc-muted: #66645c;
  --doc-line: #dfdccf;
  --doc-accent: #fcb800;
  --doc-accent-dark: #a56f00;
  --doc-green: #167a55;
  --doc-blue: #205b85;
  --doc-shadow: 0 18px 50px rgba(24, 24, 23, 0.08);
  --doc-radius: 8px;
  --doc-header-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--doc-bg);
  color: var(--doc-text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

body,
button,
input,
textarea,
select {
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
li,
td,
th,
strong,
span,
a {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  overflow-wrap: anywhere;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid #e3dfcf;
  border-radius: 6px;
  background: #f5f1e2;
  color: #1f433a;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  line-height: 1.4;
  padding: 0.12rem 0.35rem;
}

strong {
  font-weight: 750;
}

.docs-container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  min-width: 0;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 220, 207, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.docs-nav {
  min-height: var(--doc-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: max-content;
  font-weight: 800;
}

.docs-brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--doc-text);
  color: var(--doc-accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.docs-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.docs-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.docs-links a,
.docs-sidebar a,
.docs-footer a {
  border-radius: 8px;
  color: var(--doc-muted);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
}

.docs-links a:hover,
.docs-sidebar a:hover,
.docs-footer a:hover,
.docs-sidebar a.is-active {
  background: #f4efd9;
  color: var(--doc-text);
}

.docs-links .docs-cta {
  background: var(--doc-text);
  color: #fff;
}

.docs-links .docs-cta:hover {
  background: #2a2927;
  color: #fff;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(42px, 1fr));
  align-items: center;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: #f7f5ec;
  padding: 3px;
}

.lang-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--doc-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 0.7rem;
}

.lang-button.is-active {
  background: var(--doc-text);
  color: var(--doc-accent);
}

.lang-button:focus-visible,
.docs-links a:focus-visible,
.docs-sidebar a:focus-visible,
.docs-footer a:focus-visible {
  outline: 3px solid rgba(252, 184, 0, 0.45);
  outline-offset: 2px;
}

.docs-hero {
  border-bottom: 1px solid var(--doc-line);
  background: var(--doc-surface);
  padding: 72px 0 54px;
}

.docs-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: end;
  min-width: 0;
}

.docs-kicker {
  margin: 0 0 0.75rem;
  color: var(--doc-accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-hero h1,
.doc-section h2,
.doc-section h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.docs-hero h1 {
  max-width: 820px;
  font-size: clamp(2.3rem, 4.5vw, 4.8rem);
}

.docs-hero-copy {
  max-width: 760px;
  margin: 1.25rem 0 0;
  color: var(--doc-muted);
  font-size: 1.08rem;
}

.docs-summary {
  min-width: 0;
  border: 1px solid var(--doc-line);
  border-top: 5px solid var(--doc-accent);
  border-radius: var(--doc-radius);
  background: var(--doc-surface-soft);
  box-shadow: var(--doc-shadow);
  padding: 1.15rem;
}

.docs-summary strong {
  display: block;
  margin-bottom: 0.65rem;
}

.docs-summary ul,
.check-list,
.step-list {
  margin: 0;
  padding: 0;
}

.docs-summary li,
.check-list li {
  list-style: none;
}

.docs-summary li,
.check-list li,
.step-list li {
  position: relative;
  margin-top: 0.55rem;
  color: var(--doc-muted);
}

.check-list li {
  padding-left: 1.55rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58rem;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--doc-green);
}

.step-list {
  counter-reset: doc-step;
  display: grid;
  gap: 0.65rem;
}

.step-list li {
  counter-increment: doc-step;
  list-style: none;
  min-height: 38px;
  padding-left: 3rem;
}

.step-list li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dbc568;
  border-radius: 8px;
  background: #fff7d6;
  color: #6e4d00;
  font-weight: 850;
}

.docs-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 36px;
  padding: 34px 0 66px;
  min-width: 0;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--doc-header-height) + 22px);
  align-self: start;
  display: grid;
  gap: 0.18rem;
  max-height: calc(100vh - var(--doc-header-height) - 44px);
  overflow: auto;
  padding: 0.45rem;
}

.docs-content {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.doc-section {
  min-width: 0;
  scroll-margin-top: calc(var(--doc-header-height) + 20px);
  border: 1px solid var(--doc-line);
  border-radius: var(--doc-radius);
  background: var(--doc-surface);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.doc-section h2 {
  max-width: 820px;
  margin-bottom: 0.9rem;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.doc-section h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
  font-size: 1.14rem;
}

.doc-section p {
  max-width: 860px;
  margin: 0.85rem 0 0;
  color: var(--doc-muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
  min-width: 0;
}

.info-grid article {
  border: 1px solid var(--doc-line);
  border-radius: var(--doc-radius);
  background: var(--doc-surface-soft);
  padding: 1rem;
}

.info-grid article strong {
  display: block;
  margin-bottom: 0.4rem;
}

.info-grid article p {
  margin: 0;
  font-size: 0.95rem;
}

.callout {
  margin-top: 1.25rem;
  border: 1px solid #d8c674;
  border-left: 5px solid var(--doc-accent);
  border-radius: var(--doc-radius);
  background: #fff8dc;
  color: #5a4200;
  padding: 1rem;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  border: 1px solid var(--doc-line);
  border-radius: var(--doc-radius);
  background: var(--doc-surface-soft);
  margin-top: 0.72rem;
  padding: 0.8rem;
  min-width: 0;
}

.code-row span {
  color: var(--doc-muted);
}

table {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  border: 1px solid var(--doc-line);
  border-radius: var(--doc-radius);
  border-spacing: 0;
  background: var(--doc-surface);
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--doc-line);
  color: var(--doc-muted);
  padding: 0.82rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3efe2;
  color: var(--doc-text);
  font-size: 0.86rem;
  font-weight: 850;
}

tr:last-child td {
  border-bottom: 0;
}

[data-doc-lang-block][hidden] {
  display: none !important;
}

.docs-footer {
  border-top: 1px solid var(--doc-line);
  background: var(--doc-text);
  color: #f6f5ef;
  padding: 1.2rem 0;
}

.docs-footer .docs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.docs-footer a {
  color: var(--doc-accent);
}

html[dir="rtl"] body {
  font-family:
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
}

html[dir="rtl"] .docs-nav,
html[dir="rtl"] .docs-footer .docs-container {
  direction: rtl;
}

html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
}

html[dir="rtl"] .check-list li {
  padding-left: 0;
  padding-right: 1.55rem;
}

html[dir="rtl"] .check-list li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .step-list li {
  padding-left: 0;
  padding-right: 3rem;
}

html[dir="rtl"] .step-list li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .callout {
  border-left-width: 1px;
  border-right: 5px solid var(--doc-accent);
}

@media (max-width: 1040px) {
  .docs-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 0;
  }

  .docs-nav-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .docs-links {
    justify-content: flex-start;
  }

  .docs-hero-grid,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: relative;
    top: auto;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    max-height: none;
    overflow-x: auto;
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-radius);
    background: rgba(255, 255, 255, 0.72);
  }
}

@media (max-width: 760px) {
  :root {
    --doc-header-height: 118px;
  }

  .docs-container {
    width: min(1160px, calc(100% - 28px));
  }

  .docs-header {
    position: relative;
  }

  .docs-nav {
    gap: 0.85rem;
  }

  .docs-brand {
    white-space: normal;
    width: 100%;
  }

  html[dir="rtl"] .docs-brand {
    justify-content: flex-end;
  }

  .docs-hero {
    padding: 42px 0 36px;
  }

  .docs-hero h1 {
    max-width: calc(100vw - 56px);
    font-size: 1.75rem;
    line-height: 1.08;
  }

  .docs-hero-copy {
    max-width: calc(100vw - 56px);
  }

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

  .docs-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
  }

  .docs-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding: 0.45rem 0.5rem;
    text-align: center;
  }

  .language-switcher {
    width: 100%;
    max-width: none;
  }

  .info-grid,
  .code-row {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .docs-sidebar a {
    min-width: 0;
    text-align: center;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: normal;
  }

  th,
  td {
    min-width: 170px;
  }
}

@media (max-width: 360px) {
  .docs-links,
  .docs-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .docs-hero h1 {
    font-size: 1.65rem;
  }

  .doc-section {
    padding: 1rem;
  }

  th,
  td {
    min-width: 150px;
    padding: 0.72rem;
  }
}
