/* Guide editor — стили на базе gide-pdf */
.guide-editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .guide-editor-layout { grid-template-columns: 1fr; }
}
.guide-editor-sidebar {
  background: var(--lp-surface, #fff);
  border: 1px solid var(--lp-border, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}
.guide-editor-preview-wrap {
  background: var(--lp-surface, #fff);
  border: 1px solid var(--lp-border, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  min-height: 400px;
}
.guide-field { display: block; margin-bottom: 12px; }
.guide-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.guide-pages-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.guide-page-tab {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--lp-border, #ddd);
  background: #f8fafc; cursor: pointer; font-size: 13px;
}
.guide-page-tab.is-active { background: #2563eb; color: #fff; border-color: #2563eb; }
.guide-section-card {
  border: 1px solid var(--lp-border, #e2e8f0); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fafafa;
}
.guide-section-card h4 { margin: 0 0 8px; font-size: 14px; }
.guide-rich-body {
  min-height: 80px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; font-size: 14px; line-height: 1.5;
}
.guide-rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.guide-rich-toolbar button {
  padding: 4px 8px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  background: #fff; cursor: pointer;
}
.guide-preview-page {
  width: 794px;
  max-width: 100%;
  min-height: auto;
  box-sizing: border-box;
  border-radius: 12px;
  padding: 22px 20px;
  margin: 0 auto 16px;
}
#ge-preview .guide-preview-page {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.guide-preview-section {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.guide-preview-page h2 {
  font-size: 1.6em;
  line-height: 1.25;
  margin: 0 0 8px;
}
.guide-preview-page h3 {
  font-size: 1.2em;
  line-height: 1.3;
  margin: 0 0 16px;
}
.guide-preview-section strong {
  font-size: 1.05em;
  line-height: 1.35;
}
.guide-preview-section p,
.guide-preview-section li {
  line-height: 1.45;
  margin: 0 0 0.35em;
}
.guide-preview-section ul,
.guide-preview-section ol {
  margin: 0.25em 0 0.45em;
  padding-left: 1.25em;
}
.guide-preview-section p:last-child,
.guide-preview-section li:last-child {
  margin-bottom: 0;
}
.guide-preview-body p {
  line-height: 1.45;
  margin: 0 0 0.35em;
}
.guide-preview-body ul,
.guide-preview-body ol {
  margin: 0.25em 0 0.45em;
  padding-left: 1.25em;
}
.guide-preview-body p:last-child {
  margin-bottom: 0;
}
.guide-preview-section a,
.guide-preview-section-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.guide-preview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
}
.guide-brand-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.9;
}
.guide-brand-panel {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.guide-brand-panel-title {
  margin: 0 0 10px;
  font-size: 14px;
}
.guide-field-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.guide-field-check input {
  width: auto;
}
.guide-logo-preview {
  min-height: 40px;
  margin-bottom: 8px;
}
#ge-preview {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.guide-ui-panel {
  margin: 14px 0;
  padding-top: 4px;
}
.guide-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.guide-color-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.guide-color-field span {
  font-weight: 600;
  color: #475569;
  line-height: 1.25;
}
.guide-color-field input[type="color"] {
  width: 100%;
  height: 32px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.ge-modal-preview,
.ge-page-preview {
  width: min(100%, 720px);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  border: 1px solid var(--ge-border, #e2e8f0);
  background: var(--ge-modal-bg, #fff);
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, sans-serif;
  min-height: 520px;
  max-height: min(780px, 78vh);
}
.ge-modal-preview-head,
.ge-page-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ge-border, #e2e8f0);
  background: var(--ge-head-bg, #fff);
}
.ge-modal-preview-head strong,
.ge-page-preview-head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ge-head-text, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.ge-modal-close {
  display: none;
}
.ge-modal-preview-viewport,
.ge-page-preview-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  background: var(--ge-viewport-bg, #eef2f7);
  display: flex;
  justify-content: center;
}
.ge-modal-preview-viewport .guide-preview-page,
.ge-page-preview-viewport .guide-preview-page {
  margin: 0;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}
.ge-modal-preview-foot,
.ge-page-preview-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--ge-border, #e2e8f0);
  background: var(--ge-foot-bg, #fff);
  align-items: center;
}
.ge-modal-preview-foot button,
.ge-page-preview-foot button {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  min-height: 42px;
  box-sizing: border-box;
  cursor: default;
}
.ge-modal-nav {
  border: 1px solid var(--ge-nav-border, #d1d5db);
  background: var(--ge-nav-bg, #fff);
  color: var(--ge-nav-color, #0f172a);
  justify-self: start;
}
.ge-modal-preview-foot .ge-modal-nav:last-child,
.ge-page-preview-foot .ge-modal-nav:last-child {
  justify-self: end;
}
.ge-modal-dl {
  border: none;
  background: var(--ge-dl-bg, #2563eb);
  color: var(--ge-dl-color, #fff);
  font-weight: 600;
  justify-self: center;
  padding: 10px 20px;
}
.guide-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guide-publish-block {
  margin-top: 16px; padding: 12px; background: #f1f5f9; border-radius: 10px; font-size: 13px;
}
.guide-publish-block code { display: block; margin-top: 6px; word-break: break-all; }
