.s-shell:has(.sh-page) {
  min-height: 100vh;
}

.sh-page {
  display: flex;
  flex: 1;
  min-height: 0;
  width: min(100%, 1120px);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.55);
  border-left: 1px solid var(--s-line);
  border-right: 1px solid var(--s-line);
}

.sh-loading,
.sh-error {
  margin: 48px auto;
  padding: 0 24px;
  color: var(--s-muted);
  font-size: 1rem;
}

.sh-error {
  color: #9b2c2c;
}

.sh-topics {
  flex: 0 0 min(320px, 38vw);
  max-width: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--s-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sh-topics__head {
  flex-shrink: 0;
  padding: 22px 18px 14px;
  border-bottom: 1px solid var(--s-line);
}

.sh-topics__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 550;
}

.sh-topics__lead {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--s-muted);
  line-height: 1.45;
}

.sh-topics__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.sh-topic-btn,
.sh-question-btn,
.sh-support-btn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sh-topic-btn {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--s-ink);
}

.sh-topic-btn:hover {
  background: rgba(47, 107, 79, 0.08);
}

.sh-topic-btn[data-active] {
  background: rgba(47, 107, 79, 0.14);
  color: var(--s-leaf-deep);
}

.sh-questions {
  list-style: none;
  margin: 0 0 8px;
  padding: 2px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sh-question-btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--s-muted);
  line-height: 1.4;
}

.sh-question-btn:hover {
  background: rgba(47, 107, 79, 0.06);
  color: var(--s-ink);
}

.sh-question-btn[data-active] {
  background: rgba(47, 107, 79, 0.1);
  color: var(--s-leaf-deep);
  font-weight: 700;
}

.sh-topics__footer {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--s-line);
}

.sh-support-btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--s-line);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--s-leaf-deep);
}

.sh-support-btn:hover,
.sh-support-btn[data-active] {
  background: rgba(47, 107, 79, 0.08);
}

.sh-answer {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 22px 40px;
}

.sh-feed-title {
  margin: 0 0 18px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 550;
}

.sh-card {
  margin: 0 0 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--s-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  scroll-margin-top: 16px;
}

.sh-card[data-active] {
  border-color: rgba(47, 107, 79, 0.35);
  box-shadow: 0 0 0 1px rgba(47, 107, 79, 0.12);
}

.sh-card__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.sh-card__text {
  margin: 0;
  color: var(--s-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-line;
}

.sh-card__text a {
  font-weight: 600;
}

@media (max-width: 820px) {
  .sh-page {
    flex-direction: column;
    border-left: none;
    border-right: none;
  }

  .sh-topics {
    flex: none;
    width: 100%;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--s-line);
  }

  .sh-topics__head {
    padding-left: 8px;
    padding-right: 8px;
  }

  .sh-topics__scroll {
    overflow: visible;
    padding-left: 4px;
    padding-right: 4px;
  }

  .sh-topics__footer {
    padding-left: 8px;
    padding-right: 8px;
  }

  .sh-answer {
    padding: 14px 8px 20px;
  }

  .sh-feed-title {
    margin-bottom: 10px;
  }

  .sh-card {
    margin: 0 0 8px;
  }

  .sh-questions {
    margin-bottom: 4px;
    gap: 0;
  }
}

/* Ближе к краям экрана: хедер/футер на странице справки */
@media (max-width: 640px) {
  .s-shell:has(.sh-page) .s-header__inner,
  .s-shell:has(.sh-page) .s-footer__inner {
    width: min(100% - 12px, var(--s-max));
  }
}