/* Without enhancement the native accordions remain in normal document flow. */
.faq-scroll-hint {
  display: none;
  max-width: 60rem;
  margin: 1.5rem 0 0;
  color: rgba(243, 240, 231, .78);
  font-size: .875rem;
  line-height: 1.7;
}
.faq[data-faq-enhanced] .faq-scroll-hint { display: block; }
.faq[data-faq-enhanced] .faq-list { margin-top: 1rem; }
.faq-list[data-faq-ready] {
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  /* Let wheel/touch scrolling continue onto the page at either boundary. */
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}
.faq-list:focus-visible,
.faq-list summary:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}
.faq-list summary h3 { overflow-wrap: anywhere; }
.faq-list p { overflow-wrap: anywhere; }

/* Only a successfully enhanced dialog changes interaction or page scrolling. */
.faq-dialog {
  display: none;
  width: calc(100% - 2rem);
  max-width: 46rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(201, 243, 107, .45);
  border-radius: .75rem;
  background: var(--forest-deep);
  color: var(--paper);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .5);
  overflow: hidden;
}
.faq-dialog[open] { display: flex; flex-direction: column; }
.faq-dialog::backdrop { background: rgba(0, 0, 0, .76); }
.faq-dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.faq-dialog-header h2 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.faq-dialog-close {
  flex-shrink: 0;
  max-width: 45%;
  padding: .55rem .8rem;
  border: 1px solid var(--acid);
  border-radius: 2rem;
  background: var(--acid);
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.faq-dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 1.75rem);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.faq-dialog-body p { margin: 0; line-height: 1.9; color: rgba(243, 240, 231, .85); }
.faq-dialog button:focus-visible,
.faq-dialog-body:focus-visible,
.faq-dialog a:focus-visible { outline: 2px solid var(--acid); outline-offset: -3px; }
html.faq-modal-open { overflow: hidden; scrollbar-gutter: stable; }
html.faq-modal-open body { position: fixed; width: 100%; top: 0; }
html.faq-modal-open,
html.faq-modal-restoring { scroll-behavior: auto !important; }
/* No entrance animation: reduced-motion visitors get the same instant dialog. */
@media (max-width: 480px) {
  .faq-dialog { width: calc(100% - 1rem); max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
  .faq-dialog-header { gap: .65rem; }
}
