:root {
  --muted: #6b7280;
  --radius: 10px;
  --gap-x: 24px;
  /* 列間の隙間（短い矢印の長さ） */

  /* 青系 */
  --line-blue: #4e86c8;
  --fill-blue: #eaf2ff;

  /* オレンジ系 */
  --line-orange: #f0a25a;
  --fill-orange: #fff2e5;

  /* 赤系 */
  --line-red: #c77a7a;
  --fill-red: #ffecec;

  /* 修了証・対象外 */
  --fill-cert: #fffbd6;
  --stroke-cert: #c7c200;
  --stroke-dashed: #9ca3af;
}

.flow-scroll {
  overflow: visible;
  position: relative;
}

.pc-stage {
  position: relative;
  overflow: hidden;
  font-size: 0.9rem;
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem var(--gap-x);
  position: relative;
  isolation: isolate;
}

/* 1000px以下で横スクロール化 */
@media (max-width: 1000px) {
  .flow-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }

  .pc-stage {
    min-width: 850px;
  }
}

/* =========================================================
   ステップ見出し・ボックスのスタイル
   ========================================================= */

.step-head {
  background: #e5e7eb;
  border-radius: var(--radius);
  text-align: center;
  padding: 0.5rem;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  grid-row: 1;
}

.step-head .small {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  display: block;
}

.box {
  position: relative;
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
  z-index: 2;
}

.box .note {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  display: block;
}

/* ボックスの色バリエーション */
.blue {
  background: var(--fill-blue);
  border: 2px solid var(--line-blue);
}

.orange {
  background: var(--fill-orange);
  border: 2px solid var(--line-orange);
}

.red {
  background: var(--fill-red);
  border: 2px solid var(--line-red);
}

.cert {
  background: var(--fill-cert);
  border: 2px solid var(--stroke-cert);
}

.dashed {
  background: #fff;
  border: 2px dashed var(--stroke-dashed);
}

/* =========================================================
   単独タグの矢印（.arrow と .arrow-bridge の2種類のみ）
   ========================================================= */

/* 1. 隣の列へ繋ぐ短い矢印（指定した列の「左側の隙間」に描画される） */
.arrow {
  position: relative;
  pointer-events: none;
  z-index: 3;
}

.arrow::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: var(--gap-x);
  height: 12px;
  background: var(--line-color);
  clip-path: polygon(0 25%,
      calc(100% - 10px) 25%,
      calc(100% - 10px) 0,
      100% 50%,
      calc(100% - 10px) 100%,
      calc(100% - 10px) 75%,
      0 75%);
}

/* 2. 空の列を飛び越える長い矢印（空セル＋左右の隙間を貫通して描画される） */
.arrow-bridge {
  position: relative;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
  margin-left: calc(var(--gap-x) * -1);
  margin-right: calc(var(--gap-x) * -1);
}

.arrow-bridge::after {
  content: "";
  width: 100%;
  height: 12px;
  background: var(--line-color);
  clip-path: polygon(0 25%,
      calc(100% - 10px) 25%,
      calc(100% - 10px) 0,
      100% 50%,
      calc(100% - 10px) 100%,
      calc(100% - 10px) 75%,
      0 75%);
}

/* 矢印の色バリエーション */
.blue-line {
  --line-color: var(--line-blue);
}

.orange-line {
  --line-color: var(--line-orange);
}

.red-line {
  --line-color: var(--line-red);
}