/* PCA — /guide (общий ku_hdr + ku-layout) */
body.guide-page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  background: #0a0a0c;
  color: #e8e8ed;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
body.guide-page *,
body.guide-page *::before,
body.guide-page *::after {
  box-sizing: border-box;
}

body.ku-guide-page .hdr-inst.guide.active {
  background: rgba(48, 209, 88, 0.22);
  border-color: rgba(48, 209, 88, 0.55);
  color: #30d158;
}

body.guide-page .ku-page-hdr {
  margin: 0 0 16px;
}
body.guide-page .ku-page-hdr .hdr {
  margin-left: 0;
  margin-right: 0;
}

.guide-wrap.ku-page-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  line-height: 1.65;
  color: #e8e8ed;
}

body.guide-page .ku-pca-brand .ku-pca-slogan {
  position: static;
  box-shadow: none;
  margin-top: 4px;
}

.guide-hero-emblem {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: #1c1c1e;
  border: 1px solid #38383a;
  position: relative;
  box-shadow: 0 8px 28px rgba(10, 132, 255, 0.15);
}
.guide-hero-emblem::before,
.guide-hero-emblem::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #0a84ff;
}
.guide-hero-emblem::before {
  width: 14px;
  height: 14px;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -18px 28px 0 -2px #0a84ff, 18px 28px 0 -2px rgba(10, 132, 255, 0.92);
}
.guide-hero-emblem::after {
  width: 2px;
  height: 18px;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  background: transparent;
  box-shadow: -9px 4px 0 0 rgba(10, 132, 255, 0.45), 9px 4px 0 0 rgba(10, 132, 255, 0.45);
}

.guide-hero {
  text-align: center;
  padding: 28px 20px 36px;
  margin-bottom: 28px;
  background: linear-gradient(145deg, #1a1a2e 0%, #12121a 100%);
  border: 1px solid #2c2c2e;
  border-radius: 20px;
}
.guide-hero h1 { font-size: 28px; font-weight: 800; color: #f5f5f7; margin: 0 0 10px; }
.guide-hero p { font-size: 15px; color: #98989d; max-width: 640px; margin: 0 auto 20px; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.guide-actions .btn,
.guide-admin-links .btn {
  padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.guide-actions .btn-pdf { background: #30d158; color: #000; }
.guide-actions .btn-print { background: #2c2c2e; color: #f5f5f7; border: 1px solid #48484a; }
.guide-admin-links {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: -12px 0 24px;
}
.guide-admin-links .btn-edit { background: #0a84ff; color: #fff; }
.guide-admin-links .btn-edit-sub { background: transparent; color: #98989d; border: 1px solid #48484a; }

.guide-toc {
  background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 16px;
  padding: 20px 24px; margin-bottom: 32px;
}
.guide-toc h2 { font-size: 16px; margin: 0 0 14px; color: #f5f5f7; }
.guide-toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } }
.guide-toc li { margin: 6px 0; font-size: 14px; }
.guide-toc a { color: #0a84ff; text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }

.guide-chapter { margin-bottom: 48px; scroll-margin-top: 120px; }
.guide-chapter > h2 {
  font-size: 22px; font-weight: 800; color: #f5f5f7;
  border-bottom: 2px solid #0a84ff; padding-bottom: 10px; margin: 0 0 20px;
}
.guide-section { margin-bottom: 28px; }
.guide-collapse {
  margin-bottom: 16px;
  background: #161618;
  border: 1px solid #2c2c2e;
  border-radius: 14px;
  overflow: hidden;
}
.guide-collapse > summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #f5f5f7;
  padding: 14px 18px;
  list-style: none;
  user-select: none;
}
.guide-collapse > summary::-webkit-details-marker { display: none; }
.guide-collapse > summary::before {
  content: "▸ ";
  color: #0a84ff;
  font-weight: 800;
}
.guide-collapse[open] > summary::before { content: "▾ "; }
.guide-section-fold { padding: 0 18px 16px; margin-bottom: 0; }
.guide-section h3 { font-size: 17px; font-weight: 700; color: #f5f5f7; margin: 0 0 12px; }
.guide-section p { font-size: 15px; color: #c7c7cc; margin: 0 0 12px; }
.guide-step {
  background: #161618; border: 1px solid #2c2c2e; border-radius: 14px;
  padding: 18px 20px; margin: 16px 0;
}
.guide-step-num {
  display: inline-block; background: #0a84ff; color: #fff;
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 8px;
  margin-bottom: 10px;
}
.guide-step h4 { font-size: 15px; font-weight: 700; color: #f5f5f7; margin: 0 0 10px; }
.guide-step p { font-size: 14px; color: #aeaeb2; margin: 0 0 10px; }
.guide-step ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: #aeaeb2; }
.guide-step li { margin: 6px 0; }
.guide-figure {
  margin: 14px 0 4px; text-align: center;
  background: #0d0d0f; border-radius: 12px; padding: 12px; border: 1px solid #2c2c2e;
}
.guide-figure img,
.guide-figure picture,
.guide-figure video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.guide-figure-broken {
  min-height: 80px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.guide-figure-broken::before {
  content: "⚠️ Иллюстрация не загрузилась — обновите страницу (Ctrl+F5)";
  font-size: 13px; color: #98989d; padding: 24px 16px; text-align: center;
}
.guide-figure figcaption {
  font-size: 12px; color: #636366; margin-top: 10px; font-style: italic;
}
.guide-figure-demo { margin-top: 8px; border-color: rgba(48, 209, 88, 0.35); }
.guide-figure-gif img {
  max-width: 800px;
  width: 100%;
  height: auto;
}

.guide-demo-gif {
  max-width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.guide-demo-cap { color: #30d158; font-style: normal; font-weight: 600; }
.guide-figure-video { border-color: rgba(10, 132, 255, 0.4); }
.guide-video-cap { color: #64d2ff; font-style: normal; font-weight: 600; }
.guide-demo-video { background: #000; }
.guide-tip, .guide-warn {
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 12px;
}
.guide-tip { background: rgba(10, 132, 255, 0.12); border-left: 4px solid #0a84ff; color: #7eb8ff; }
.guide-warn { background: rgba(255, 69, 58, 0.12); border-left: 4px solid #ff453a; color: #ff9f9a; }
.guide-glossary dt { font-weight: 700; color: #f5f5f7; margin-top: 14px; }
.guide-glossary dd { margin: 4px 0 0; color: #aeaeb2; font-size: 14px; }

/* Editor */
.guide-edit-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .guide-edit-layout { grid-template-columns: 1fr; }
}
.guide-edit-side {
  background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 14px; padding: 16px;
  position: sticky; top: 100px;
}
.guide-edit-chapters { list-style: none; margin: 0 0 12px; padding: 0; }
.guide-edit-chapters button {
  width: 100%; text-align: left; padding: 8px 10px; margin: 4px 0;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: #c7c7cc; font-size: 13px; cursor: pointer; font-family: inherit;
}
.guide-edit-chapters button.active {
  background: rgba(10, 132, 255, 0.15); border-color: #0a84ff; color: #f5f5f7;
}
.guide-edit-main label {
  display: block; font-size: 13px; font-weight: 600; color: #98989d;
  margin: 12px 0 6px;
}
.guide-edit-main input[type="text"],
.guide-edit-main textarea {
  width: 100%; background: #161618; border: 1px solid #38383a; border-radius: 10px;
  padding: 10px 12px; color: #f5f5f7; font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}
.guide-edit-hint { font-weight: 400; font-size: 11px; color: #636366; }
.guide-edit-media {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  border: 1px dashed #48484a; background: #121214;
}
.guide-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.guide-edit-msg { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.guide-edit-msg.ok { background: rgba(48, 209, 88, 0.15); color: #30d158; }
.guide-edit-msg.err { background: rgba(255, 69, 58, 0.15); color: #ff9f9a; }
.guide-preview-pane {
  margin-top: 20px; padding: 16px; border: 1px solid #2c2c2e; border-radius: 14px;
  background: #0d0d0f;
}

@media print {
  .hdr, .guide-actions, .guide-admin-links, .logout-btn, #auth-overlay { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .guide-wrap { max-width: 100%; padding: 0; }
  .guide-chapter { page-break-inside: avoid; }
  .guide-figure { border: 1px solid #ccc; }
  .guide-step, .guide-toc { background: #f5f5f5; border-color: #ddd; }
  .guide-step p, .guide-section p { color: #333; }
}
