@import url("tokens.css");
@import url("fonts.css");
:root {
  --shadow: none;
  --radius: var(--radius-card);
  --font: var(--font-sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); min-height: 100vh; max-width: 100%; }
.shell > div, .content { min-width: 0; }
.side {
  background: var(--navy); color: #eef3fb;
  align-self: stretch; min-height: 100vh; max-width: 100%; overflow: hidden;
}
.side nav {
  position: sticky; top: 0; max-height: 100vh; overflow: auto; overflow-x: hidden;
  padding: 20px 16px; max-width: 100%;
}
.side strong, .side a { overflow-wrap: anywhere; max-width: 100%; }
.side strong { display: block; font-size: 1.1rem; margin-bottom: 12px; letter-spacing: -0.02em; }
.side .search, .side input {
  width: 100%; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
  color: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; min-height: 42px;
}
.side a {
  display: block; color: rgba(238,243,251,0.88); text-decoration: none;
  padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: 0.92rem;
}
.side a:hover { background: rgba(16,185,129,0.24); color: var(--sidebar-ink); }
.top {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 16px 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.top a { font-weight: 650; }
.top button, .copy, [data-lang] {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; min-height: 38px; font-weight: 700; cursor: pointer;
}
.top .menu { display: none; }
[data-lang], [data-theme-toggle] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.content { padding: 22px 28px 56px; max-width: 860px; overflow-wrap: anywhere; }
.callout, section, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); max-width: 100%; min-width: 0;
}
.callout { background: var(--brand-soft); border-color: var(--line); }
p, li, h1, h2, td, th, figcaption, dd { unicode-bidi: plaintext; }
.content table { max-width: 100%; }
.table-scroll { overflow-x: auto; max-width: 100%; }
h1, h2 { letter-spacing: -0.02em; margin: 0 0 10px; color: var(--ink); }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.25rem; }
p, li { color: var(--ink); }
.toc { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr; unicode-bidi: isolate;
}
pre {
  background: #0b1220; color: #eef3fb; border-radius: 12px; padding: 14px;
  overflow-x: auto; max-width: 100%; box-sizing: border-box;
}
.menu { display: none; }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; width: min(280px, 86vw);
    min-height: 0; height: 100vh; max-width: 86vw; overflow: hidden;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  .side nav { position: static; max-height: 100%; height: 100%; }
  html[dir="rtl"] .side { transform: translateX(105%); }
  .side.open { transform: none; }
  .top .menu { display: inline-flex; }
  .top, .content { padding-inline: 16px; }
}
