/* Справочная — дизайн в стиле Контур.Помощь / Контур.Диадок */

.help-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 80px;
}

@media (max-width: 960px) {
  .help-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 20px 20px 60px;
  }

  .help-article {
    padding: 8px 12px 48px;
  }
}

.help-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  padding: 22px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

@media (max-width: 960px) {
  .help-sidebar {
    position: static;
    max-height: none;
  }
}

.help-sidebar__title {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.help-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-nav > li + li {
  margin-top: 20px;
}

.help-nav__section {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.help-nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-nav__links li + li {
  margin-top: 3px;
}

.help-nav__links a {
  display: block;
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.help-nav__links a:hover,
.help-nav__links a.is-active {
  color: var(--color-accent-active);
  background: var(--color-accent-soft);
  font-weight: 600;
}

.help-main {
  min-width: 0;
}

.help-search {
  margin-bottom: 32px;
}

.help-search label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.help-search input {
  width: 100%;
  max-width: 520px;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.help-search input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.help-catalog h2 {
  margin: 36px 0 12px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.help-catalog h2:first-child {
  margin-top: 0;
}

.help-catalog ul {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.help-catalog li {
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.help-catalog li a {
  display: block;
  padding: 14px 4px;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}

.help-catalog li a:hover {
  color: var(--color-accent-hover);
}

.help-catalog li.is-hidden {
  display: none;
}

.help-catalog__empty {
  display: none;
  padding: 24px;
  color: var(--color-text-muted);
  background: var(--color-bg-page);
  border-radius: 10px;
}

.help-catalog__empty.is-visible {
  display: block;
}

/* Страница статьи */

.help-article {
  padding: 8px 0 60px;
  max-width: 820px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@media (max-width: 960px) {
  .help-main,
  .help-article {
    padding: 8px 12px 48px;
  }
}

.help-breadcrumb {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--color-text-soft);
}

.help-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.help-breadcrumb a:hover {
  color: var(--color-accent-hover);
}

.help-article h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 38px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.help-article__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.help-article__header h1 {
  margin: 0;
  flex: 1;
}

.help-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-soft);
  background: var(--color-bg-alt, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-top: 4px;
}

.help-copy-btn:hover {
  background: #ffffff;
  color: var(--color-text);
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.help-copy-btn.is-copied {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.help-article__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.help-article__actions .help-cabinet-cta {
  margin: 0;
}

.help-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.help-back-to-top:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.help-article__intro {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.help-article__steps {
  margin: 0 0 32px;
  padding-left: 1.35rem;
}

.help-article__steps li {
  margin-bottom: 12px;
  padding-left: 4px;
  line-height: 1.55;
}

.help-article__body h2 {
  margin: 36px 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.help-article__body h3 {
  margin: 22px 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.help-article__body p {
  margin: 0 0 14px;
  line-height: 1.65;
}

.help-article__body ul,
.help-article__body ol {
  margin: 0 0 18px;
  padding-left: 1.35rem;
}

.help-article__body li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.help-article__body .help-tips {
  margin: 8px 0 22px;
}

.help-article__body .help-tips p {
  margin: 0;
}

.help-figure {
  margin: 0 0 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-page);
  box-shadow: var(--shadow-sm);
}

.help-figure img {
  width: 100%;
  min-height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f6f8 0%, #e5e8ec 100%);
  cursor: zoom-in;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.help-figure img:hover,
.help-article__body img:hover {
  opacity: 0.96;
}

.help-article__body img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

/* Лайтбокс / Модальное окно увеличения скриншотов */
.help-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.help-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.help-lightbox__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.help-lightbox__toolbar {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1000002;
  display: flex;
  gap: 10px;
  align-items: center;
}

.help-lightbox__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.help-lightbox__btn svg {
  display: block;
  flex-shrink: 0;
}

.help-lightbox__btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  color: #ffffff;
}

.help-lightbox__btn--close {
  width: 38px;
  padding: 0;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
}

.help-lightbox__btn--close:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.05);
}

.help-lightbox__viewport {
  position: relative;
  z-index: 1000001;
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 68px 24px 24px;
  box-sizing: border-box;
}

.help-lightbox.is-zoomed .help-lightbox__viewport {
  display: block;
  overflow: auto;
  text-align: center;
  padding: 72px 24px 40px;
}

.help-lightbox__content {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  animation: helpLightboxScale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-lightbox.is-zoomed .help-lightbox__content {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  width: max-content;
  max-width: none;
}

@keyframes helpLightboxScale {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.help-lightbox__image {
  display: block;
  max-width: 96vw;
  max-height: calc(88vh - 50px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  background: #ffffff;
  cursor: zoom-in;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.help-lightbox.is-zoomed .help-lightbox__image {
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  cursor: zoom-out;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.95);
}

.help-lightbox__info {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 900px;
}

.help-lightbox__caption {
  margin: 0;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.help-lightbox__hint {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  user-select: none;
}

body.lightbox-open {
  overflow: hidden !important;
}

.help-figure figcaption {
  padding: 12px 18px;
  font-size: 13px;
  color: var(--color-text-soft);
  border-top: 1px solid var(--color-border);
  background: #ffffff;
}

.help-figure--mock {
  border-style: dashed;
  box-shadow: none;
}

.help-screenshot-mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  aspect-ratio: 16 / 9;
  padding: 32px;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.help-screenshot-mock__label {
  color: var(--color-text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-screenshot-mock__text {
  max-width: 520px;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.help-tips {
  margin: 0 0 32px;
  padding: 22px 26px;
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 12px 12px 0;
}

.help-tips h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.help-tips ul {
  margin: 0;
  padding-left: 1.2rem;
}

.help-tips li {
  margin-bottom: 8px;
}

.help-related {
  margin: 0 0 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.help-related h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.help-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-related li + li {
  margin-top: 8px;
}

.help-cabinet-cta {
  margin-top: 12px;
}

.help-cabinet-cta .btn {
  display: inline-flex;
}
