/* SMTP/API transactional gallery. Scope is limited to this one section. */
#qapi-usecases-title { scroll-margin-top: 120px; }
#qapi-scenarios-gallery {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  position: relative;
  gap: 18px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  padding: 3px 0;
}
#qapi-scenarios-gallery::-webkit-scrollbar { display: none; }
#qapi-scenarios-gallery[data-dragging="true"] { cursor: grabbing; }
#qapi-scenarios-gallery:focus-visible {
  outline: 2px solid var(--qapi-accent, #7443ef);
  outline-offset: 5px;
  border-radius: 18px;
}
#qapi-scenarios-gallery > .qapi-usecase-card {
  box-sizing: border-box;
  flex: 0 0 min(352px, calc(100% - 22px));
  min-width: 0;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid #e4ddee;
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  color: #211632;
}
#qapi-scenarios-gallery .qapi-usecase-card__heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
}
#qapi-scenarios-gallery .qapi-usecase-card__num {
  flex: 0 0 auto;
  margin: 0;
  color: var(--qapi-accent, #7443ef);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
#qapi-scenarios-gallery .qapi-usecase-card h3 {
  margin: 0;
  min-height: 52px;
  color: #211632;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.02em;
}
#qapi-scenarios-gallery .qapi-usecase-card > p {
  margin: 0;
  min-height: 93px;
  color: #665e73;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 400;
}
#qapi-scenarios-gallery .qapi-mail-preview {
  position: relative;
  flex: 0 0 auto;
  margin: 16px 0;
  border: 1px solid #e4ddee;
  border-radius: 10px;
}
#qapi-scenarios-gallery .qapi-mail-letter {
  position: relative;
  border-radius: inherit;
}
#qapi-scenarios-gallery .qapi-mail-letter img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: inherit;
  pointer-events: none;
  -webkit-user-drag: none;
}
#qapi-scenarios-gallery .qapi-mail-letter::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(116,67,239,.22), 0 8px 22px rgba(116,67,239,.15);
}
#qapi-scenarios-gallery .qapi-mail-letter.is-arriving {
  animation: qapi-mail-arrival 620ms cubic-bezier(.23,1,.32,1) backwards;
}
#qapi-scenarios-gallery .qapi-mail-letter.is-arriving::after {
  animation: qapi-mail-glow 500ms 240ms ease-out;
}
#qapi-scenarios-gallery .qapi-mini-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: auto 0 0;
  padding: 0;
  border: 0;
}
#qapi-scenarios-gallery .qapi-mini-flow :is(span, strong) {
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}
#qapi-scenarios-gallery .qapi-mini-flow span { color: #665e73; }
#qapi-scenarios-gallery .qapi-mini-flow i { display: none; }
#qapi-scenarios-gallery .qapi-mini-flow strong {
  color: var(--qapi-accent, #7443ef);
  font-weight: 500;
}
#qapi-scenarios-gallery .qapi-mini-flow strong::before { content: '→ '; }
@keyframes qapi-mail-arrival {
  0% { opacity: 0; transform: translate(24px,-20px) rotate(-2deg) scale(.97); }
  72% { opacity: 1; transform: translate(-1px,2px) rotate(.3deg) scale(1); }
  100% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
}
@keyframes qapi-mail-glow { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 460px) {
  #qapi-scenarios-gallery { gap: 14px; }
  #qapi-scenarios-gallery > .qapi-usecase-card { flex-basis: calc(100% - 20px); padding: 18px; }
  #qapi-scenarios-gallery .qapi-usecase-card h3 { font-size: 19px; }
}
@media (max-width: 360px) {
  #qapi-scenarios-gallery .qapi-usecase-card > p { min-height: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  #qapi-scenarios-gallery .qapi-mail-letter.is-arriving,
  #qapi-scenarios-gallery .qapi-mail-letter.is-arriving::after { animation: none; }
}
