/* Shared “?” help control (Explore lesson type, account preferences, etc.) */

.filter-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex-wrap: wrap;
}

.context-help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.context-help-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.context-help-btn,
.lesson-type-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  border: 1.5px solid #a49ab3;
  border-radius: 50%;
  background: transparent;
  color: #6b647c;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.context-help-btn:hover,
.context-help-btn:focus,
.lesson-type-help-btn:hover,
.lesson-type-help-btn:focus {
  border-color: #4b4557;
  color: #4b4557;
  outline: none;
}

.context-help-tooltip,
.lesson-type-help-tooltip {
  display: none;
  position: absolute;
  z-index: 40;
  width: min(280px, calc(100vw - 24px));
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5e1ec;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #4b4557;
  text-align: left;
}

.context-help-tooltip p + p,
.lesson-type-help-tooltip p + p {
  margin-top: 8px;
}

.context-help-tooltip--below-start,
.lesson-type-help-tooltip {
  left: 0;
  top: calc(100% + 8px);
}

.filter-section-heading .context-help-tooltip,
.filter-section-heading .lesson-type-help-tooltip {
  left: 0;
  top: calc(100% + 8px);
}

.context-help-tooltip--below-end {
  right: 0;
  top: calc(100% + 8px);
}

.context-help-wrap.is-help-open > .context-help-tooltip,
.context-help-wrap.is-help-open .context-help-tooltip,
.filter-section-heading.is-help-open .context-help-tooltip,
.filter-section-heading.is-help-open .lesson-type-help-tooltip {
  display: block;
}

/* Viewport-aware placement (set by context-help.js when opened) */
.context-help-tooltip.context-help-tooltip--positioned,
.lesson-type-help-tooltip.context-help-tooltip--positioned {
  position: fixed !important;
  z-index: 2400;
  left: auto;
  right: auto;
  top: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Account type rows: “?” stays on the option’s row, not under it */
.preference-item.context-help-wrap {
  flex-wrap: nowrap;
  align-items: center;
}

.preference-item .context-help-trigger {
  display: inline-flex;
  align-items: center;
  align-self: center;
}

.inline-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
