html {
  scroll-behavior: smooth;
}

.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.help-toc-inner {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: 1rem;
  background: #f9f9f9;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.help-toc-inner strong {
  display: block;
  margin-bottom: .55rem;
  color: #33C3F0;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 1.05rem;
}

.help-toc-inner a {
  display: block;
  padding: .35rem .55rem;
  border-radius: 6px;
  color: #444;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1.25;
  transition: background .15s ease, color .15s ease;
}

.help-toc-inner a:hover {
  background: #eaf6fc;
  color: #1EAEDB;
}

.help-toc-inner a.toc-sub {
  padding-left: 1.4rem;
  font-size: 1rem;
  color: #666;
}

.help-content {
  min-width: 0;
}

.help-content pre {
  overflow-x: auto;
}

.help-content h4,
.help-content h5 {
  scroll-margin-top: 1rem;
}

.role-desc {
  margin: .15rem 0 .8rem;
  color: #6b7a85;
  font-style: italic;
  font-size: 1.25rem;
}

details.role-details {
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 0 1rem;
  margin: .7rem 0;
  background: #fff;
  scroll-margin-top: 1rem;
  transition: box-shadow .2s ease;
}

details.role-details[open] {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

details.role-details > summary {
  cursor: pointer;
  list-style: none;
  padding: .85rem .2rem;
  font-weight: 700;
  color: #2aa9cf;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

details.role-details > summary::-webkit-details-marker {
  display: none;
}

details.role-details > summary::before {
  content: "\25B8";
  display: inline-block;
  color: #1EAEDB;
  transition: transform .2s ease;
}

details.role-details[open] > summary::before {
  transform: rotate(90deg);
}

details.role-details .role-img {
  margin-top: .6rem;
}

.role-img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: .4rem 0 1rem;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2.25rem;
}

.set-card {
  margin: 0;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.set-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
}

.set-card img {
  display: block;
  width: 100%;
  height: auto;
}

.set-card figcaption {
  padding: .6rem .8rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  font-size: 1.15rem;
}

/* Сворачиваемый заголовок «Содержание» — нужен только на телефоне */
.help-toc-summary {
  display: none;
}

@media (max-width: 750px) {
  .help-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: .5rem;
  }

  /* Обёртка details на мобильном: аккуратная карточка */
  .help-toc-details {
    display: block;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
  }

  /* Заголовок-переключатель */
  .help-toc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .85rem 1rem;
    cursor: pointer;
    list-style: none;
    color: #33C3F0;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 1rem;
    font-weight: 700;
    user-select: none;
  }

  .help-toc-summary::-webkit-details-marker {
    display: none;
  }

  .help-toc-summary::after {
    content: "\25B8";
    color: #1EAEDB;
    font-size: 1.1rem;
    transition: transform .2s ease;
  }

  .help-toc-details[open] > .help-toc-summary::after {
    transform: rotate(90deg);
  }

  /* Раскрытый список: вертикальные строки с разделителями */
  .help-toc-inner {
    position: static;
    max-height: none;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0;
    background: #fff;
    border: 0;
    border-top: 1px solid #e1e1e1;
    border-radius: 0;
    overflow: visible;
  }

  .help-toc-inner strong {
    display: none;
  }

  .help-toc-inner a {
    display: block;
    padding: .7rem 1rem;
    font-size: 1.1rem;
    line-height: 1.35;
    border-bottom: 1px solid #eee;
    border-radius: 0;
  }

  .help-toc-inner a:last-child {
    border-bottom: 0;
  }

  .help-toc-inner a.toc-sub {
    padding-left: 2.1rem;
    font-size: 1.05rem;
    color: #666;
    background: #fcfcfc;
  }

  .help-toc-inner a:active {
    background: #eaf6fc;
  }
}

.help-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  vertical-align: middle;
}
