/* NXClient manual — the manual's own styles. Tokens, the top bar, the phone
   drawer links and the buttons are shared with every other page and live in
   assets/site.css (generated by docs/guide/gen_manual.py), loaded before
   this file. */
:root { --sidebar-w: 264px; }

html { scroll-behavior: smooth; }
body { line-height: 1.6; }
a { color: var(--crimson-soft); text-decoration: none; transition: color .2s; }
a:hover { color: var(--crimson); }

/* ---- layout ---- */
.shell { display: flex; padding-top: var(--topbar-h); position: relative; z-index: 5; }

/* Left padding puts the link text (12px inside each link) on the shared
   gutter, under the top bar's logo. */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  overflow-y: auto; padding: 26px 16px 40px calc(var(--gutter) - 12px); border-right: 1px solid var(--line);
  background: rgba(12, 11, 13, 0.6);
}
.sidebar-home {
  display: block; font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--silver);
  padding: 0 12px 18px;
}
.sidebar-home:hover { color: var(--text); }
/* The top bar's links (Возможности / Скачать / Telegram), shown only on
   phones, where the bar folds them away and this sidebar is the ☰ drawer. */
.sidebar-site { display: none; }
.nav-group { margin-bottom: 22px; }
.nav-group-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); padding: 0 12px; margin-bottom: 8px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--silver); font-size: 14.5px; font-weight: 500; line-height: 1.2;
  border: 1px solid transparent;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav-link .ix { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 18px; }
.nav-link[aria-current="page"] {
  background: rgba(224, 48, 63, 0.12); border-color: rgba(224, 48, 63, 0.3); color: #fff;
}
.nav-link[aria-current="page"] .ix { color: var(--crimson-soft); }

.content {
  flex: 1; min-width: 0; margin-left: var(--sidebar-w);
  padding: 48px clamp(24px, 5vw, 72px) 96px; max-width: calc(760px + 10vw);
}

/* ---- typography ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--crimson-soft);
  margin-bottom: 16px;
}
.content h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08; letter-spacing: -0.5px; margin-bottom: 18px;
}
.content .lead { font-size: 18px; color: var(--silver); margin-bottom: 14px; line-height: 1.55; }
.content h2 {
  font-family: var(--display); font-weight: 700; font-size: clamp(21px, 2.4vw, 27px);
  letter-spacing: -0.3px; margin: 44px 0 16px; padding-top: 8px;
}
.content h3 { font-family: var(--body); font-weight: 700; font-size: 18px; margin: 28px 0 10px; }
.content p { margin: 0 0 14px; color: var(--text); }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; }
.content li { margin-bottom: 7px; }
.content li::marker { color: var(--crimson); }
.content strong { color: #fff; font-weight: 700; }
.content code {
  font-family: var(--mono); font-size: 0.88em; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--silver);
}
hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); padding: 12px 16px;
  background: rgba(255, 255, 255, 0.025); border-bottom: 1px solid var(--line2);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--silver); }
tbody tr:last-child td { border-bottom: none; }
tbody td:first-child { color: var(--text); }

/* ---- callouts ---- */
.callout {
  position: relative; display: flex; gap: 12px; padding: 14px 16px; margin: 0 0 18px;
  border: 1px solid var(--line2); border-left-width: 3px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); font-size: 14.5px; color: var(--silver);
}
.callout .ic { flex: none; font-size: 16px; line-height: 1.5; }
.callout p { margin: 0; color: inherit; }
.callout.info { border-left-color: #4ea6c9; }
.callout.warn { border-left-color: var(--crimson); background: rgba(224, 48, 63, 0.06); }
.callout.tip  { border-left-color: #58c977; }

/* ---- screenshot slots (styled "coming soon") ---- */
figure.shot {
  margin: 0 0 22px; border: 1px dashed var(--line2); border-radius: 12px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 12px, transparent 12px 24px);
  min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 28px;
}
figure.shot .shot-badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--crimson-soft); border: 1px solid rgba(224, 48, 63, 0.35); border-radius: 100px; padding: 4px 12px;
}
figure.shot .shot-icon { width: 34px; height: 34px; color: var(--muted); opacity: .7; }
figure.shot figcaption { font-size: 13.5px; color: var(--muted); max-width: 420px; }

/* real screenshot present */
figure.shot.has-img {
  display: block; padding: 0; min-height: 0; text-align: left;
  border-style: solid; border-color: var(--line2); background: var(--bg2); overflow: hidden;
}
figure.shot.has-img img { width: 100%; display: block; }
figure.shot.has-img.portrait { max-width: 320px; margin-left: auto; margin-right: auto; }
figure.shot.has-img figcaption {
  max-width: none; padding: 10px 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}

/* ---- inline TODO stub ---- */
.stub {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px;
  color: var(--muted); border: 1px dashed var(--line2); border-radius: 7px; padding: 2px 9px;
  background: rgba(255, 255, 255, 0.015);
}
.stub::before { content: "⋯"; color: var(--crimson-soft); font-size: 14px; }

/* ---- prev / next ---- */
.prevnext { display: flex; gap: 14px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); }
.pn {
  flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.015);
  color: var(--text); transition: border-color .2s, background .2s;
}
.pn:hover { border-color: var(--line2); background: rgba(255, 255, 255, 0.03); color: var(--text); }
.pn.next { text-align: right; }
.pn .pn-dir { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.pn .pn-title { font-weight: 700; font-size: 15.5px; }
.pn.disabled { opacity: .35; pointer-events: none; }

/* ---- manual index (card grid) ---- */
.idx-hero { margin-bottom: 40px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; padding: 20px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.015); transition: border-color .2s, transform .15s, background .2s;
}
.card:hover { border-color: rgba(224, 48, 63, 0.35); transform: translateY(-2px); background: rgba(255, 255, 255, 0.03); }
.card .card-ix { font-family: var(--mono); font-size: 12px; color: var(--crimson-soft); }
.card .card-title { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text); margin: 8px 0 6px; }
.card .card-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.idx-group-title { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 36px 0 14px; }

/* ---- mobile ---- */
/* Below 900px the sidebar becomes the ☰ drawer (its button and the .scrim
   are in site.css); below 800px — where site.css folds the top bar's links —
   it also carries them. */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%); transition: transform .25s ease; z-index: 25;
    width: 280px; background: var(--bg2); padding-left: 16px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { margin-left: 0; padding: 32px 22px 80px; }
}
@media (max-width: 800px) {
  .sidebar-site { display: flex; padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .prevnext { flex-direction: column; }
  .content h1 { font-size: clamp(28px, 9vw, 38px); }
}
