/* 정산대행 전용: 기존 5단계 연결선 모션과 모바일 배치를 유지한다. */
/* 지급대행과 아이콘 크기 통일: 원형 PC 80px/모바일 64px, 내부 SVG 32px. */
.flow-section {
    --flow-icon-size: var(--icon-size-lg);
}
/* 상점과 결과 문서만 선을 살짝 얇게 하여 시각적 무게를 보정한다. */
.flow-section .flow__chip .flow__icon--light {stroke-width: 1.4;}
@media (max-width: 768px) {
    /* 배지와 첫 아이콘 사이를 줄이며 연결선 거리 계산에도 같은 값을 사용한다. */
    .flow-section {
        --flow-chip-size: var(--spacing-64);
        --flow-steps-gap-top: var(--spacing-24);
        --flow-mobile-header-height: calc(var(--spacing-48) + var(--flow-role-height) + var(--flow-steps-gap-top));
    }
    /* PAYUP 배지 위 여백을 확보해 경계 화살표 아래로 분리한다. */
    .flow-section .flow__group--payup {padding-top: var(--spacing-48);}
    /* 중앙 배지를 점선보다 앞에 두고 불투명 배경으로 뒤쪽 연결선을 가린다. */
    .flow-section .flow__role {
        position: relative;
        z-index: 2;
        align-self: center;
        margin-left: 0;
        background-color: var(--color-bg-white);
    }
}

.flow-section .flow__dots::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(-1 * var(--flow-sweep-width) - var(--flow-connector-clearance) - var(--flow-connector-index) * 20cqw);
    width: var(--flow-sweep-width);
    height: 100%;
    background: linear-gradient(to right, transparent, var(--flow-sweep-color) 40%, var(--flow-sweep-color) 60%, transparent);
    opacity: var(--flow-sweep-opacity);
    animation: flow-soft-sweep var(--flow-connector-duration) linear infinite;
}
.flow-section .flow__step--1 {--flow-connector-index: 0;}
.flow-section .flow__step--2 {--flow-connector-index: 1;}
.flow-section .flow__step--3 {--flow-connector-index: 2;}
.flow-section .flow__step--4 {--flow-connector-index: 3;}
@keyframes flow-soft-sweep {
    0% {transform: translateX(0);}
    30%, 40% {transform: translateX(var(--flow-sweep-handoff));}
    54% {transform: translateX(var(--flow-sweep-exit));}
    100% {transform: translateX(var(--flow-sweep-travel));}
}
.flow-section .flow__handoff::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: calc(-1 * var(--flow-handoff-border-width));
    left: calc(-1 * var(--flow-handoff-border-width));
    width: calc(100% + var(--flow-handoff-border-width) * 2);
    height: calc(100% + var(--flow-handoff-border-width) * 2);
    border-radius: var(--radius-full);
    background: conic-gradient(transparent 0deg 310deg, var(--flow-handoff-ring-color) 330deg 360deg);
    mask-image: radial-gradient(closest-side, transparent calc(100% - var(--flow-handoff-ring-width)), #000 calc(100% - var(--flow-handoff-ring-width)));
    opacity: 0;
    pointer-events: none;
    animation: flow-handoff-ring var(--flow-connector-duration) linear infinite;
}
@keyframes flow-handoff-ring {
    0%, 30% {transform: rotate(-90deg); opacity: 0;}
    33% {opacity: 1;}
    51% {opacity: 1;}
    54%, 100% {transform: rotate(270deg); opacity: 0;}
}

@media (max-width: 768px) {
    .flow-section .flow {flex-direction: column;}
    .flow-section .flow__group--merchant {padding-bottom: var(--flow-mobile-merchant-bottom); border-radius: var(--flow-inner-radius) var(--flow-inner-radius) 0 0;}
    .flow-section .flow__group--payup {position: relative; border-radius: 0 0 var(--flow-inner-radius) var(--flow-inner-radius);}
    .flow-section .flow__steps {flex-direction: column; gap: var(--flow-mobile-gap);}
    .flow-section .flow__step {min-height: var(--flow-mobile-step-height);}
    .flow-section .flow__connector {
        display: block;
        z-index: 1;
        top: calc(100% + var(--flow-mobile-edge));
        left: calc(50% - var(--flow-connector-height) / 2);
        width: var(--flow-connector-height);
        height: calc(var(--flow-mobile-gap) - var(--flow-mobile-edge) * 2);
    }
    .flow-section .flow__connector--handoff {
        height: calc(var(--flow-mobile-merchant-bottom) + var(--flow-mobile-header-height) - var(--flow-mobile-edge) * 2);
    }
    .flow-section .flow__dots {
        width: 100%;
        height: calc(100% - var(--flow-chevron-size) - var(--flow-connector-gap));
        mask-image: repeating-linear-gradient(to bottom, #000 0 var(--flow-mobile-dash-length), transparent var(--flow-mobile-dash-length) var(--flow-mobile-dash-period));
    }
    .flow-section .flow__connector--handoff .flow__dots {height: 100%;}
    .flow-section .flow__dots::after {
        top: calc(-1 * var(--flow-mobile-sweep-height) - var(--flow-mobile-offset));
        left: 0;
        width: 100%;
        height: var(--flow-mobile-sweep-height);
        background: linear-gradient(to bottom, transparent, var(--flow-sweep-color) 40%, var(--flow-sweep-color) 60%, transparent);
        animation-name: flow-soft-sweep-vertical;
    }
    .flow-section .flow__step--1 {--flow-mobile-offset: 0px;}
    .flow-section .flow__step--2 {--flow-mobile-offset: calc(var(--flow-mobile-step-height) + var(--flow-mobile-gap));}
    .flow-section .flow__step--3 {--flow-mobile-offset: var(--flow-mobile-late-offset);}
    .flow-section .flow__step--4 {--flow-mobile-offset: var(--flow-mobile-last-offset);}
    .flow-section .flow__chevron {
        top: auto;
        bottom: 0;
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(90deg);
    }
    .flow-section .flow__handoff {
        top: 0;
        left: 50%;
        margin-top: calc(var(--flow-handoff-size) / -2);
    }
    .flow-section .flow__handoff .flow__icon {transform: rotate(90deg);}
}
@keyframes flow-soft-sweep-vertical {
    0% {transform: translateY(0);}
    30%, 40% {transform: translateY(var(--flow-mobile-sweep-handoff));}
    54% {transform: translateY(calc(var(--flow-mobile-sweep-handoff) + var(--flow-mobile-gap)));}
    100% {transform: translateY(var(--flow-mobile-sweep-travel));}
}

@media (prefers-reduced-motion: reduce) {
    /* Reduced Motion */
    .flow-section .flow__dots::after {animation: none; display: none;}
    .flow-section .flow__handoff::after {animation: none; display: none;}
}
