.faq-dialog:not([open]) {
  display: none;
}

.faq-dialog-open {
  overflow: hidden;
}

.faq-dialog[open] {
  position: fixed;
  inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(480px, calc(100% - 48px));
  height: min(680px, calc(100vh - 48px));
  height: min(680px, calc(100dvh - 48px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 24px rgb(0 0 0 / 25%);
}

.faq-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.faq-dialog__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 16px;
  background: #005bd2;
  color: #fff;
}

.faq-dialog__header h2 {
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.faq-dialog__header button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.faq-dialog__header button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}

.faq-dialog__frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
}

@media (max-width: 520px) {
  .faq-dialog[open] {
    inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }
}
