/* =============================================================================
   Справка «Самопил» — общие стили документации
   Генерируется скриптом scripts/build_help_docs.py. Правьте токены здесь.
   ========================================================================== */
:root {
  --wood-1: #c98f54;
  --wood-2: #a96b30;
  --blue: #2f6fed;
  --blue-dark: #1e51c9;
  --ink: #2c2117;
  --ink-soft: #52493c;
  --muted: #8a8377;
  --cream: #fbf7ef;
  --cream-2: #f7f4ee;
  --panel: #ffffff;
  --line: #e6ddcf;
  --line-soft: #efe7d8;
  --tip: #eaf0fe;
  --tip-line: #bcd0fb;
  --warn: #fdf1e6;
  --warn-line: #f0c99b;
  --ok: #eaf6ec;
  --ok-line: #bfe2c4;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(60, 45, 25, 0.08);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.62;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 247, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand svg { border-radius: 10px; }
.topbar__tag {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.topbar__spacer { flex: 1; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  padding: 9px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--cream-2); }

/* ---------- Layout ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.side {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 22px 4px 40px;
}
.side__search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: var(--panel);
  margin-bottom: 16px;
}
.side__search:focus { outline: 2px solid var(--tip-line); border-color: var(--blue); }
.side__group { margin-bottom: 18px; }
.side__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 12px;
}
.side__link {
  display: block;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
}
.side__link:hover { background: var(--cream-2); text-decoration: none; color: var(--ink); }
.side__link.is-active {
  background: var(--tip);
  color: var(--blue-dark);
  box-shadow: inset 3px 0 0 var(--blue);
}
.side__empty { color: var(--muted); font-size: 14px; padding: 8px 12px; display: none; }

/* mobile nav toggle */
.navtoggle { display: none; }
.navtoggle__btn { display: none; }

/* ---------- Content ---------- */
.content {
  padding: 30px 0 80px;
  min-width: 0;
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wood-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wood-1); }

.content h1 {
  font-size: 38px;
  line-height: 1.15;
  margin: 12px 0 10px;
  letter-spacing: -0.01em;
}
.lead { font-size: 20px; color: var(--ink-soft); margin: 0 0 8px; }
.content h2 {
  font-size: 26px;
  margin: 44px 0 12px;
  padding-top: 8px;
  letter-spacing: -0.01em;
}
.content h3 { font-size: 20px; margin: 28px 0 8px; }
.content p { margin: 12px 0; }
.content ul, .content ol { margin: 12px 0; padding-left: 22px; }
.content li { margin: 6px 0; }
.content strong { font-weight: 700; }

.anchor {
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
  opacity: 0;
  font-size: 0.7em;
  text-decoration: none;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* figures */
figure {
  margin: 24px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
figure svg { display: block; width: 100%; height: auto; }
figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* callouts */
.callout {
  border-radius: 12px;
  padding: 14px 18px;
  margin: 20px 0;
  border: 1px solid var(--tip-line);
  background: var(--tip);
}
.callout p { margin: 6px 0; }
.callout__title { font-weight: 800; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.callout--tip { background: var(--tip); border-color: var(--tip-line); }
.callout--warn { background: var(--warn); border-color: var(--warn-line); }
.callout--ok { background: var(--ok); border-color: var(--ok-line); }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0; }
.steps > li {
  position: relative;
  padding: 4px 0 18px 52px;
  margin: 0;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.steps h3 { margin: 4px 0 2px; font-size: 18px; }

/* key / hotkey */
kbd {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

/* tables */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--cream-2); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
tr:last-child td { border-bottom: none; }

/* cards on hub */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--tip-line); text-decoration: none; }
.card__ic { width: 40px; height: 40px; margin-bottom: 10px; }
.card__t { font-weight: 800; font-size: 17px; color: var(--ink); margin: 0 0 4px; }
.card__d { font-size: 14px; color: var(--muted); margin: 0; }

/* pager */
.pager {
  display: flex;
  gap: 14px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.pager a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
}
.pager a:hover { border-color: var(--tip-line); text-decoration: none; }
.pager small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
.pager b { display: block; margin-top: 3px; color: var(--ink); font-size: 16px; }
.pager .next { text-align: right; }

/* footer */
.foot {
  border-top: 1px solid var(--line);
  background: var(--cream-2);
  margin-top: 40px;
}
.foot__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.foot__in a { color: var(--ink-soft); font-weight: 600; }
.foot__sp { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; gap: 0; }
  .content h1 { font-size: 30px; }
  .lead { font-size: 18px; }
  .navtoggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 16px 0 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
  }
  .navtoggle:not(:checked) ~ .side__body { display: none; }
  .side__body { padding-top: 14px; }
  .content { padding-top: 20px; }
}
