/* ===========================================================================
   ServicesAiAgent — Story / Film & Problem Cards
   =========================================================================== */

.aa-film {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.aa-film__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: center;
}
@media (max-width: 1180px) {
  .aa-film__body {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Cards grid on left / top */
.aa-problem-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aa-problem-card {
  background: #FFFFFF;
  border: 1px solid #DCE4EC;
  border-left: 4px solid #DCE4EC;
  padding: 16px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .3s, background-color .3s, box-shadow .3s;
}
.aa-problem-card:hover {
  border-color: #1B6FB3;
}
.aa-problem-card.is-on {
  border-left-color: #1B6FB3;
  background: #F8FBFE;
  box-shadow: 0 4px 12px rgba(27, 111, 179, .08);
}
.aa-problem-card__h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: #102A43;
}
.aa-problem-card.is-on .aa-problem-card__h3 {
  color: #1B6FB3;
}
.aa-problem-card__desc {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #5A6B7C;
}

/* State 4 highlight: when on state 4 (本番運用), cards return to clean state without reducing contrast */
.aa-s4 .aa-problem-card {
  border-color: #DCE4EC;
  background: #FFFFFF;
}

/* Stepper Bar under figure */
.aa-film__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.aa-film__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #DCE4EC;
  border-radius: 8px;
  background: #FFFFFF;
  font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #102A43;
  cursor: pointer;
  overflow: hidden;
  transition: all .2s ease;
  min-height: 44px;
  box-sizing: border-box;
}
.aa-film__btn:hover {
  border-color: #1B6FB3;
  color: #1B6FB3;
}
.aa-film__btn.is-on {
  border-color: #1B6FB3;
  background: #E8F1FA;
  color: #1B6FB3;
}
.aa-film__btn:last-of-type.is-on {
  border-color: #2B745F;
  background: #EAF5F0;
  color: #23764F;
}

/* Progress bar inside active button when autoplaying */
.aa-film.is-live .aa-film__btn.is-on::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #1B6FB3;
  transform-origin: left;
  animation: aa-prog 6s linear forwards;
}
.aa-film.is-live .aa-film__btn:last-of-type.is-on::after {
  background: #23764F;
}
.aa-film.is-held .aa-film__btn.is-on::after {
  animation-play-state: paused;
}
@keyframes aa-prog {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Play/Pause Button */
.aa-film__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #DCE4EC;
  border-radius: 8px;
  background: #FFFFFF;
  color: #102A43;
  font-size: 16px;
  cursor: pointer;
  transition: border-color .2s;
  flex: none;
  min-height: 44px;
}
.aa-film__play[hidden] {
  display: none !important;
}
.aa-film__play:hover {
  border-color: #1B6FB3;
  color: #1B6FB3;
}
