/* FAQ uses the same surfaces, typography and radii as the existing site dialogs. */
.modal--faq {
  width: min(1040px, 100%);
  height: min(780px, calc(100vh - 48px));
  height: min(780px, calc(100dvh - 48px));
  min-height: 0;
}

.modal--faq .modal__lead { margin-top: 8px; }
.modal--faq [hidden] { display: none !important; }

.faq-search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin-top: 22px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
}

.faq-search:focus-within { border-color: rgba(255, 255, 255, 0.5); }
.faq-search svg { flex: 0 0 auto; }
.faq-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
}
.faq-search input::placeholder { color: var(--muted); }
.faq-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.faq-search__clear {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 12px;
}
.faq-search__clear:hover { color: var(--text); background: var(--surface-strong); }

.faq-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  min-height: 0;
  margin-top: 24px;
}
.faq-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 4px 0;
  border-right: 1px solid var(--line);
}
.faq-nav__item {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: left;
  line-height: 1.4;
  font-size: 0.8125rem;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.faq-nav__item:hover { color: var(--text); background: var(--surface); }
.faq-nav__item[aria-pressed="true"] {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-strong);
}
.faq-results {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 10px 4px 0;
}
.faq-section.is-following { margin-top: 30px; }
.faq-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.faq-group { margin-top: 18px; }
.faq-group__title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}
.faq-item {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}
.faq-item:first-of-type { margin-top: 0; }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary:hover { background: rgba(255, 255, 255, 0.025); border-radius: var(--radius-sm); }
.faq-item__chevron {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
.faq-item[open] .faq-item__chevron { transform: rotate(225deg) translate(-1px, -1px); }
.faq-item__answer {
  padding: 0 16px 16px;
  color: #b5b5b5;
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.faq-status {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.75rem;
}
.faq-status:empty { display: none; }
.faq-empty { max-width: 34ch; padding: 30px 0; color: var(--muted); font-size: 0.875rem; }
.faq-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.faq-footer a, .faq-footer button { padding: 4px 0; }
.faq-footer a:hover, .faq-footer button:hover { color: var(--text); }
.faq-footer span { margin-left: 4px; }

@media (max-width: 700px) {
  .modal--faq { padding: 22px 18px; height: calc(100vh - 28px); height: calc(100dvh - 28px); }
  .faq-search { margin-top: 16px; }
  .faq-layout { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
  .faq-nav {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 2px 2px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .faq-nav__item { white-space: nowrap; padding: 9px 11px; }
  .faq-results { flex: 1 1 auto; padding-right: 4px; }
  .faq-section__title { font-size: 1rem; }
  .faq-item summary { padding: 13px 12px; gap: 12px; }
  .faq-item__answer { padding: 0 12px 14px; }
  .faq-footer { margin-top: 16px; padding-top: 10px; }
}

@media (max-height: 480px) {
  .modal--faq { padding: 18px 22px; }
  .modal--faq .modal__lead { display: none; }
  .faq-search { margin-top: 12px; }
  .faq-layout { margin-top: 12px; gap: 12px; }
  .faq-footer { margin-top: 12px; padding-top: 8px; }
}
