/* Контекстные подсказки «?» — pzh-risk.ru, v1.0 */
.hh-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  /* 2026-11-21: было -12px — зона нажатия 44px налезала на соседнее поле
     сверху на 10px и перехватывала тапы по его верхней кромке. */
  margin: -4px 0 -4px 4px;
  padding: 0;
  border: 0;
  background: transparent;
  vertical-align: middle;
  position: relative;
  z-index: 10022; /* 2026-11-23: поднимаем над .aic-fab (z-index 10021), иначе плавающая кнопка ИИ-чата перехватывает клик по «?» */
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.hh-hint-btn__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: .55;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: opacity .15s ease, background .15s ease;
}

.hh-hint-btn:hover .hh-hint-btn__ico,
.hh-hint-btn:focus-visible .hh-hint-btn__ico {
  opacity: 1;
  background: rgba(127, 127, 127, .18);
}

.hh-hint-btn:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: 2px;
  border-radius: 50%;
}

/* ---- модальное окно ---- */
.hh-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hh-modal[hidden] { display: none; }

.hh-modal__back {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, .6);
}

.hh-modal__panel {
  position: relative;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  color: #16181d;
  border-radius: 14px;
  padding: 22px 22px 26px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  -webkit-overflow-scrolling: touch;
}

.hh-modal__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
}

.hh-modal__close:hover { background: rgba(127, 127, 127, .16); }
.hh-modal__close:focus-visible { outline: 2px solid #2f6fed; outline-offset: 2px; }

.hh-modal__title {
  margin: 0 40px 12px 0;
  font-size: 19px;
  line-height: 1.3;
}

.hh-modal__body p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; }

.hh-modal__img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 14px;
  border-radius: 8px;
  background: #f2f4f7;
}

.hh-modal__formula {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f2f4f7;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
}

.hh-modal__links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.hh-modal__links a { font-size: 14px; }

html.hh-modal-open, html.hh-modal-open body { overflow: hidden; }

/* тёмная тема */
.dark-theme .hh-modal__panel { background: #14171d; color: #e8eaee; }
.dark-theme .hh-modal__formula { background: #1d212a; }
.dark-theme .hh-modal__img { background: #1d212a; }
.dark-theme .hh-modal__close:hover { background: rgba(255, 255, 255, .12); }

@media (max-width: 700px) {
  .hh-modal { padding: 10px; }
  .hh-modal__panel { padding: 18px 16px 22px; max-height: 90vh; }
  .hh-modal__title { font-size: 17px; }
}
