/* ========== FAQ ==========
   Оверлей/окно — тот же паттерн, что и у остальных фичевых оверлеев (см.
   reports_styles.css). Внутри — аккордеон вопрос/ответ. */

#faqOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

#faqWindow {
  background: white;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#faqContent {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* flex-shrink:0 обязателен: #faqContent — flex-column с overflow-y:auto, а
   overflow:hidden ниже даёт этому элементу (как флекс-ребёнку) автоматический
   min-height:0 по спецификации — без flex-shrink:0 браузер вместо скролла просто
   сжимает все статьи, чтобы влезть в контейнер, и обрезает лишний текст (баг,
   из-за которого на мобильном было не прокрутить FAQ вниз, см. rules_styles.css —
   тот же паттерн). */
.faq-item {
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: #f7f8fc;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:hover {
  background: #eef0fa;
}

.faq-question-arrow {
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}

.faq-item.open .faq-question-arrow {
  transform: rotate(90deg);
}

.faq-answer {
  display: none;
  padding: 12px 14px;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Лёгкая markdown-подобная разметка ответа (см. renderFaqAnswerHtml в js/faq.js) —
   абзацы/заголовки/списки уже настоящие теги, pre-wrap здесь больше не нужен. */
.faq-answer p {
  margin: 0 0 10px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer-heading {
  margin: 14px 0 6px;
  font-size: 14px;
  color: #333;
}

.faq-answer-heading:first-child {
  margin-top: 0;
}

.faq-answer ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.faq-answer ul:last-child {
  margin-bottom: 0;
}

.faq-answer li {
  margin-bottom: 4px;
}

.faq-answer strong {
  color: #333;
}
