/* flow page: .second-section / .second-section-inner は 2nd.css に合わせる */


.flow-diagram {
  max-width: 1000px;
  margin: 0 auto 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-capsule {
  background: #fff9e6;
  padding: 0 24px;
  border-radius: 999px;
  box-shadow: none;
  min-width: 90px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-capsule-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 15px;
  font-weight: 700;
  color: #e67a00;
  font-family: sans-serif;
  letter-spacing: 0.02em;
}

.flow-arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #e67a00;
  flex-shrink: 0;
}

.flow-detail-list {
  max-width: 1000px;
  margin: 0 auto 44px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 40px;
}
/* 縦の点線ライン（1本の連続線） */
.flow-detail-list::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--base) 0,
    var(--base) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.3;
}

.flow-detail-box {
  background: #ffffff;
  padding: 32px 52px;
  border-radius: 10px;
  box-shadow: none;
  position: relative;
  margin-bottom: 20px;
}
/* 左側の丸ポイント */
.flow-detail-box::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #e67a00;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #e67a00;
  z-index: 1;
}
/* 上下のマスク（線を丸の範囲に収める） */
.flow-detail-box:first-child::after {
  content: '';
  position: absolute;
  left: -32px;
  top: -1px;
  height: calc(50% - 11px);
  width: 12px;
  background: var(--yellow);
  z-index: 1;
}
.flow-detail-box:last-child { margin-bottom: 0; }
.flow-detail-box:last-child::after {
  content: '';
  position: absolute;
  left: -32px;
  bottom: -1px;
  height: calc(50% - 11px);
  width: 12px;
  background: var(--yellow);
  z-index: 1;
}

.flow-detail-notes {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.flow-detail-notes li::before {
  content: '・';
}
.flow-detail-notes li {
  font-size: 15px;
  font-weight: normal;
  line-height: 1.75;
  color: var(--base);
  font-family: sans-serif;
}

.flow-detail-title {
  font-size: 26px;
  font-weight: 700;
  color: #e67a00;
  margin: 0 0 14px 0;
  font-family: sans-serif;
  padding-top: 0;
  padding-left: 0;
}

/* オレンジ強調（吹き出し背景と同じ色） */
.flow-text-orange {
  color: #ec931a;
}

/* 2nd.css の .second-layer section p より優先させるため詳細度を上げる */
.second-layer .flow-detail-box .flow-detail-desc,
.flow-detail-box p.flow-detail-desc,
.flow-detail-box .flow-detail-desc p {
  font-size: 15px;
  font-weight: normal;
  line-height: 1.75;
  color: var(--base);
  margin: 0;
  font-family: sans-serif;
  padding-left: 0;
}

.flow-capacity {
  max-width: 800px;
  margin: 60px auto 0;
  padding: 32px 20px;
  background: linear-gradient(to right, #f4c620, #eb8423);
  border-radius: 100px;
  text-align: center;
  position: relative;
}

.flow-capacity .flow-capacity-title {
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: 0.08em;
}

.flow-capacity-desc {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.75;
  color: #fff;
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
}

.flow-capacity-highlight {
  color: #ffe567;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-decoration-color: #ffe567;
}

.flow-capacity-chara {
  position: absolute;
  right: -20px;
  bottom: -10px;
  width: 130px;
  height: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
}
.flow-capacity-chara.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: charaBounce 0.6s ease 0.3s;
}
@keyframes charaBounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-20px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* ========================================
   レスポンシブ（タブレット 768px～1023px）
   ======================================== */
@media screen and (max-width: 1023px) {
  /* フロー図（縦書きカプセル＋矢印）はPCのみ表示 */
  .flow-diagram {
    display: none;
  }

  .flow-capsule {
    min-width: 80px;
    height: 140px;
    padding: 0 20px;
  }

  .flow-capsule-text {
    font-size: 14px;
  }

  .flow-detail-list {
    margin-bottom: 36px;
    gap: 0;
    padding-left: 36px;
  }
  .flow-detail-list::before { left: 11px; }

  .flow-detail-box {
    padding: 28px 36px;
    margin-bottom: 16px;
  }
  .flow-detail-box::before {
    left: -30px;
    width: 12px;
    height: 12px;
  }
  .flow-detail-box:first-child::after { left: -30px; width: 12px; height: calc(50% - 11px); }
  .flow-detail-box:last-child::after { left: -30px; width: 12px; height: calc(50% - 11px); }

  .flow-detail-title {
    font-size: 22px;
  }

  .second-layer .flow-detail-box .flow-detail-desc,
  .flow-detail-box p.flow-detail-desc {
    font-size: 15px;
  }

  .flow-capacity {
    margin: 50px 20px 0;
    padding: 28px 20px;
  }

  .flow-capacity .flow-capacity-title {
    font-size: 20px;
  }

  .flow-capacity-chara {
    width: 100px;
    right: -10px;
    bottom: -8px;
  }
}

/* ========================================
   レスポンシブ（スマホ ～767px）
   ======================================== */
@media screen and (max-width: 767px) {
  .flow-diagram {
    margin-bottom: 28px;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .flow-diagram::-webkit-scrollbar {
    height: 6px;
  }

  .flow-diagram::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
  }

  .flow-capsule {
    min-width: 72px;
    height: 120px;
    padding: 0 16px;
    flex-shrink: 0;
  }

  .flow-capsule-text {
    font-size: 12px;
  }

  .flow-arrow {
    border-top-width: 5px;
    border-bottom-width: 5px;
    border-left-width: 8px;
    flex-shrink: 0;
  }

  .second-layer .second-section {
    padding-left: 0;
    padding-right: 0;
  }
  .second-layer .second-section-inner {
    width: 95%;
    margin: 0 auto;
    padding: 0;
  }

  .flow-detail-list {
    margin-bottom: 28px;
    gap: 0;
    padding-left: 24px;
  }
  .flow-detail-list::before { left: 4px; }

  .flow-detail-box {
    padding: 20px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
  }
  .flow-detail-box::before {
    left: -26px;
    width: 10px;
    height: 10px;
    border-width: 2px;
  }
  .flow-detail-box:first-child::after { left: -20px; width: 8px; height: calc(50% - 10px); }
  .flow-detail-box:last-child::after { left: -20px; width: 8px; height: calc(50% - 10px); }

  .flow-detail-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .second-layer .flow-detail-box .flow-detail-desc,
  .flow-detail-box p.flow-detail-desc {
    font-size: 14px;
    line-height: 1.7;
  }

  /* 吹き出し＋キャラ */
  .flow-capacity {
    margin: 40px 6px 0;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .flow-capacity .flow-capacity-title {
    font-size: 16px;
  }

  .flow-capacity-desc {
    font-size: 13px;
    line-height: 1.8;
  }

  .flow-capacity-highlight {
    font-size: 15px;
    letter-spacing: 0.05em;
  }

  .flow-capacity-chara {
    width: 60px;
    right: -10px;
    bottom: -15px;
  }
}
