/* =========================================================
   PINOSS 신청폼 모바일 인터페이스 재배치 v1.0
   목표:
   - PIN번호 제목 오른쪽에 "간편 문자추출 / 이미지 간편등록"
   - 상품권 목록 높이 확보
   - PIN 입력 2열 유지
   - 금액/빠른금액/+추가/신청버튼 흐름 정리
   ========================================================= */

.gapply-v3-pin-tools-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  margin:0 0 10px;
}

.gapply-v3-pin-tools-row .gapply-v3-label{
  margin:0!important;
  padding:0!important;
  flex:0 0 auto;
}

.gapply-v3-pin-tools{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}

.gapply-v3-pin-tools button,
.gapply-v3-pin-tools [role="button"]{
  min-width:0!important;
  height:44px!important;
  padding:0 13px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  border:1px solid #e2e8f0!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#1b2d44!important;
  font-size:13px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  box-shadow:0 5px 16px rgba(33,62,96,.06)!important;
}

.gapply-v3-pin-tools button:active,
.gapply-v3-pin-tools [role="button"]:active{
  transform:scale(.98)!important;
}

/* PIN 영역 */
.gapply-v3-pin-fields,
#giftPinFields{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
}

#giftPinFields .gapply-v3-pin-part{
  width:100%!important;
  min-width:0!important;
  height:54px!important;
  text-align:center!important;
  border-radius:12px!important;
}

/* 상품권 선택 목록 - 모바일에서 3줄 이상 잘리지 않도록 */
.gexchange-modal__body .gapply-v3-products{
  max-height:none!important;
  overflow:visible!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}

.gexchange-modal__body .gapply-v3-products button{
  min-height:72px!important;
  padding:12px!important;
  border-radius:16px!important;
}

/* 기존 상단 퀵툴이 남아있는 경우 숨김 */
.gapply-v3-quick-tools.is-moved{
  display:none!important;
}

/* 금액 / 빠른 금액 */
.gexchange-modal__body input[name*="amount"],
.gexchange-modal__body input[placeholder*="금액"]{
  min-height:56px!important;
  border-radius:13px!important;
}

.gexchange-modal__body .gapply-v3-quick-amounts{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
}

.gexchange-modal__body .gapply-v3-quick-amounts button{
  min-width:0!important;
  width:100%!important;
  height:42px!important;
  padding:0 6px!important;
  border-radius:11px!important;
  font-size:12px!important;
  font-weight:800!important;
}

/* + 추가 버튼 */
.gexchange-modal__body .gapply-v3-add,
.gexchange-modal__body .gapply-v3-add-mobile{
  width:100%!important;
  min-height:50px!important;
  border-radius:12px!important;
}

/* 최종 신청 버튼 */
.gexchange-modal__body .gapply-v3-submit-wrap{
  position:sticky!important;
  bottom:-12px!important;
  z-index:20!important;
  padding-top:12px!important;
  background:linear-gradient(to bottom,rgba(255,255,255,0),#fff 24%)!important;
}

.gexchange-modal__body .gapply-v3-submit-wrap button{
  width:100%!important;
  min-height:56px!important;
  border-radius:14px!important;
  font-size:16px!important;
  font-weight:900!important;
}

/* 모바일 최적화 */
@media(max-width:760px){
  .gexchange-modal__body{
    padding-top:10px!important;
  }

  .gapply-v3-pin-tools-row{
    gap:8px;
    margin-bottom:9px;
  }

  .gapply-v3-pin-tools{
    gap:6px;
    min-width:0;
  }

  .gapply-v3-pin-tools button,
  .gapply-v3-pin-tools [role="button"]{
    height:42px!important;
    padding:0 10px!important;
    font-size:12px!important;
    border-radius:12px!important;
  }

  .gapply-v3-pin-fields,
  #giftPinFields{
    gap:8px!important;
  }

  #giftPinFields .gapply-v3-pin-part{
    height:54px!important;
    font-size:17px!important;
  }

  .gexchange-modal__body .gapply-v3-products{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }

  .gexchange-modal__body .gapply-v3-products button{
    min-height:68px!important;
    padding:10px!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:6px!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts button{
    height:40px!important;
    font-size:11px!important;
  }
}

@media(max-width:390px){
  .gapply-v3-pin-tools-row{
    align-items:flex-start;
  }

  .gapply-v3-pin-tools{
    gap:5px;
  }

  .gapply-v3-pin-tools button,
  .gapply-v3-pin-tools [role="button"]{
    padding:0 8px!important;
    font-size:11px!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:4px!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts button{
    padding:0 3px!important;
    font-size:10px!important;
  }
}


/* v11: 단일 상품권 진입 시 전체 상품권 선택 목록을 다시 강제 표시하지 않음 */
.gexchange-modal__body .gapply-v3-single-product .gapply-v3-products{
  display:none!important;
}
.gexchange-modal__body .gapply-v3-single-product .gapply-v3-row:has(.gapply-v3-products){
  display:none!important;
}


/* v1.1: 입력 항목이 추가된 뒤 하단 정보가 잘리지 않도록 */
@media(max-width:760px){
  .gexchange-modal__body .gapply-v3-card,
  .gexchange-modal__body #giftApplyForm{
    overflow:visible!important;
    height:auto!important;
    max-height:none!important;
  }

  .gexchange-modal__body .gapply-v3-submit-wrap{
    margin-top:16px!important;
  }
}


/* v1.2 - 모바일 최종 제출버튼은 sticky 금지 */
@media(max-width:760px){
  .gexchange-modal__body .gapply-v3-submit-wrap{
    position:relative!important;
    bottom:auto!important;
    margin-top:20px!important;
    padding:0!important;
    background:none!important;
  }

  .gexchange-modal__body{
    overflow-y:scroll!important;
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch!important;
  }
}


/* =========================================================
   v1.3 PC 전용 폼 폭/간격/입력 크기 정상화
   ========================================================= */
@media(min-width:761px){

  .gapply-v3-pin-tools-row{
    display:grid!important;
    grid-template-columns:120px minmax(0,1fr)!important;
    align-items:center!important;
    gap:18px!important;
    margin:0 0 16px!important;
  }

  .gapply-v3-pin-tools-row .gapply-v3-label{
    font-size:15px!important;
    font-weight:900!important;
  }

  .gapply-v3-pin-tools{
    justify-content:flex-start!important;
    gap:10px!important;
    margin-left:0!important;
  }

  .gapply-v3-pin-tools button,
  .gapply-v3-pin-tools [role="button"]{
    height:46px!important;
    padding:0 18px!important;
    font-size:14px!important;
    border-radius:13px!important;
  }

  #giftPinFields,
  .gapply-v3-pin-fields{
    display:grid!important;
    grid-template-columns:repeat(4, minmax(0, 1fr))!important;
    gap:12px!important;
    width:100%!important;
    max-width:720px!important;
    margin:0 0 8px 138px!important;
  }

  #giftPinFields .gapply-v3-pin-part{
    height:58px!important;
    min-width:0!important;
    font-size:18px!important;
    border-radius:13px!important;
  }

  .gexchange-modal__body .gapply-v3-row{
    width:100%!important;
    grid-template-columns:120px minmax(0,1fr)!important;
    gap:18px!important;
    align-items:center!important;
  }

  .gexchange-modal__body .gapply-v3-label{
    font-size:14px!important;
    font-weight:900!important;
  }

  .gexchange-modal__body input,
  .gexchange-modal__body select{
    min-height:54px!important;
    font-size:15px!important;
    border-radius:12px!important;
  }

  .gexchange-modal__body input[name*="amount"],
  .gexchange-modal__body input[placeholder*="금액"]{
    width:min(100%, 640px)!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    width:min(100%, 640px)!important;
  }

  .gexchange-modal__body .gapply-v3-quick-amounts button{
    width:auto!important;
    min-width:82px!important;
    height:42px!important;
    padding:0 14px!important;
    font-size:13px!important;
    border-radius:11px!important;
  }

  .gexchange-modal__body .gapply-v3-add,
  .gexchange-modal__body .gapply-v3-add-mobile{
    width:min(100%, 640px)!important;
    min-height:50px!important;
    margin-left:138px!important;
  }

  /* 추가된 상품권 카드 */
  .gexchange-modal__body [class*="added"],
  .gexchange-modal__body [class*="item-card"]{
    max-width:720px!important;
  }

  /* 총금액/수수료 영역 */
  .gexchange-modal__body .gapply-v3-summary,
  .gexchange-modal__body [class*="summary"]{
    width:100%!important;
  }

  /* 계좌/비밀번호 등 후속 입력영역 */
  .gexchange-modal__body .gapply-v3-row input,
  .gexchange-modal__body .gapply-v3-row select{
    width:100%!important;
    max-width:none!important;
  }
}


/* =========================================================
   v1.4 PC FINAL
   JS가 실제 DOM 요소에 pc-* 클래스를 붙인 뒤 강제로 정렬
   기존 form HTML 구조/클래스가 달라도 적용되도록 설계
   ========================================================= */
@media(min-width:761px){

  #giftApplyForm.gapply-pc-normalized{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }

  #giftApplyForm.gapply-pc-normalized *,
  #giftApplyForm.gapply-pc-normalized *::before,
  #giftApplyForm.gapply-pc-normalized *::after{
    box-sizing:border-box!important;
  }

  /* PIN 전체 블록 */
  #giftApplyForm .pc-pin-section{
    width:100%!important;
    max-width:none!important;
    display:block!important;
    margin:0!important;
    padding:0!important;
  }

  #giftApplyForm .pc-pin-toolbar{
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    gap:12px!important;
    margin:0 0 16px!important;
  }

  #giftApplyForm .pc-pin-toolbar .gapply-v3-label{
    width:110px!important;
    flex:0 0 110px!important;
    margin:0!important;
    padding:0!important;
  }

  #giftApplyForm .pc-pin-toolbar .gapply-v3-pin-tools{
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    margin:0!important;
    width:auto!important;
  }

  #giftApplyForm .pc-pin-toolbar button,
  #giftApplyForm .pc-pin-toolbar [role="button"]{
    width:auto!important;
    min-width:150px!important;
    height:48px!important;
    padding:0 18px!important;
    white-space:nowrap!important;
    font-size:14px!important;
    line-height:1!important;
  }

  /* PIN 입력칸 */
  #giftApplyForm #giftPinFields.pc-pin-fields{
    width:100%!important;
    max-width:720px!important;
    margin:0 0 10px 0!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:12px!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-fields > *{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-fields input,
  #giftApplyForm #giftPinFields.pc-pin-fields .gapply-v3-pin-part{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
    padding:0 12px!important;
    font-size:18px!important;
    text-align:center!important;
  }

  #giftApplyForm .pc-pin-help{
    width:100%!important;
    max-width:720px!important;
    margin:10px 0 18px!important;
  }

  /* 금액 영역 */
  #giftApplyForm .pc-amount-section{
    width:100%!important;
    max-width:720px!important;
    margin:0!important;
    display:block!important;
  }

  #giftApplyForm .pc-amount-input{
    width:100%!important;
    max-width:720px!important;
    height:56px!important;
    margin:0 0 14px!important;
  }

  /* 빠른금액 행 */
  #giftApplyForm .pc-quick-section{
    width:100%!important;
    max-width:720px!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    flex-wrap:wrap!important;
    margin:0 0 16px!important;
  }

  #giftApplyForm .pc-quick-label{
    flex:0 0 auto!important;
    width:auto!important;
    margin:0!important;
    white-space:nowrap!important;
  }

  #giftApplyForm .pc-quick-buttons{
    display:flex!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    width:auto!important;
    margin:0!important;
  }

  #giftApplyForm .pc-quick-buttons button{
    width:auto!important;
    min-width:88px!important;
    height:42px!important;
    margin:0!important;
    padding:0 14px!important;
    font-size:13px!important;
  }

  /* + 추가 버튼 */
  #giftApplyForm .pc-add-button{
    width:100%!important;
    max-width:720px!important;
    min-width:0!important;
    height:52px!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  /* 이후 요약/계좌/비밀번호 */
  #giftApplyForm .pc-full-section{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
  }
}


/* =========================================================
   v1.5 PC Balanced Layout
   - 좌우 여백 / 섹션 폭 / 입력 정렬 / 요약·계좌·비밀번호 대칭 보정
   - 1024px 이상 PC 전용
   ========================================================= */
@media(min-width:1024px){

  /* 전체 폼 중심축 */
  #giftApplyForm.gapply-pc-normalized{
    width:100%!important;
    max-width:860px!important;
    margin:0 auto!important;
    padding:0!important;
  }

  #giftApplyForm.gapply-pc-normalized > *{
    max-width:100%!important;
  }

  /* 주요 카드/섹션 공통 */
  #giftApplyForm .pc-balanced-section{
    width:100%!important;
    max-width:860px!important;
    margin:0 auto 20px!important;
    padding:24px 26px!important;
    border-radius:20px!important;
    background:#fbfcfe!important;
  }

  /* PIN 툴바 */
  #giftApplyForm .pc-pin-toolbar{
    width:100%!important;
    display:grid!important;
    grid-template-columns:110px minmax(0,1fr)!important;
    align-items:center!important;
    gap:18px!important;
    margin:0 0 18px!important;
  }

  #giftApplyForm .pc-pin-toolbar .gapply-v3-label{
    width:auto!important;
    min-width:0!important;
    flex:none!important;
    font-size:15px!important;
    line-height:1.4!important;
  }

  #giftApplyForm .pc-pin-toolbar .gapply-v3-pin-tools{
    display:flex!important;
    justify-content:flex-start!important;
    gap:12px!important;
    width:auto!important;
  }

  #giftApplyForm .pc-pin-toolbar button,
  #giftApplyForm .pc-pin-toolbar [role="button"]{
    min-width:168px!important;
    height:50px!important;
    padding:0 20px!important;
    border-radius:14px!important;
  }

  /* PIN 입력 4칸 */
  #giftApplyForm #giftPinFields.pc-pin-fields{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding-left:128px!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:12px!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-fields input,
  #giftApplyForm #giftPinFields.pc-pin-fields .gapply-v3-pin-part{
    height:60px!important;
    border-radius:14px!important;
    font-size:18px!important;
  }

  #giftApplyForm .pc-pin-help{
    width:100%!important;
    max-width:none!important;
    margin:10px 0 20px!important;
    padding-left:128px!important;
    text-align:left!important;
    font-size:12px!important;
    line-height:1.6!important;
  }

  /* 금액 입력 */
  #giftApplyForm .pc-amount-section{
    width:100%!important;
    max-width:none!important;
    margin:0 0 14px!important;
  }

  #giftApplyForm .pc-amount-input{
    width:calc(100% - 128px)!important;
    max-width:none!important;
    height:58px!important;
    margin:0 0 14px 128px!important;
  }

  /* 빠른금액 */
  #giftApplyForm .pc-quick-section{
    width:100%!important;
    max-width:none!important;
    display:grid!important;
    grid-template-columns:110px minmax(0,1fr)!important;
    align-items:center!important;
    gap:18px!important;
    margin:0 0 18px!important;
  }

  #giftApplyForm .pc-quick-label{
    width:auto!important;
    margin:0!important;
    text-align:left!important;
  }

  #giftApplyForm .pc-quick-buttons{
    display:flex!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:10px!important;
    width:100%!important;
  }

  #giftApplyForm .pc-quick-buttons button{
    min-width:92px!important;
    height:42px!important;
    padding:0 16px!important;
  }

  /* + 추가 */
  #giftApplyForm .pc-add-button{
    width:calc(100% - 128px)!important;
    max-width:none!important;
    height:54px!important;
    margin:0 0 22px 128px!important;
    border-radius:14px!important;
  }

  /* 추가된 상품권 카드 */
  #giftApplyForm .pc-added-card{
    width:calc(100% - 128px)!important;
    max-width:none!important;
    margin:0 0 18px 128px!important;
  }

  /* 요약 */
  #giftApplyForm .pc-summary-section{
    display:grid!important;
    grid-template-columns:110px 1fr 150px 1fr!important;
    align-items:center!important;
    gap:14px 18px!important;
    width:100%!important;
    padding:22px 26px!important;
  }

  #giftApplyForm .pc-summary-section input{
    width:100%!important;
    height:54px!important;
  }

  /* 계좌정보 / 비밀번호 */
  #giftApplyForm .pc-account-section,
  #giftApplyForm .pc-password-section{
    display:grid!important;
    grid-template-columns:110px minmax(0,1fr)!important;
    align-items:start!important;
    gap:18px!important;
    width:100%!important;
    padding:22px 26px!important;
  }

  #giftApplyForm .pc-account-fields{
    display:grid!important;
    grid-template-columns:1.05fr 1.1fr 1.1fr 90px 84px 84px!important;
    gap:10px!important;
    align-items:center!important;
    width:100%!important;
  }

  #giftApplyForm .pc-account-fields input,
  #giftApplyForm .pc-account-fields select{
    width:100%!important;
    min-width:0!important;
    height:52px!important;
  }

  #giftApplyForm .pc-account-fields .pc-phone-dash{
    display:none!important;
  }

  #giftApplyForm .pc-account-extra{
    grid-column:2 / -1!important;
    margin-top:10px!important;
  }

  #giftApplyForm .pc-password-fields{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:12px!important;
    width:100%!important;
  }

  #giftApplyForm .pc-password-fields input{
    width:100%!important;
    height:52px!important;
  }

  /* 최종 신청 버튼 */
  #giftApplyForm .gapply-v3-submit-wrap{
    width:100%!important;
    max-width:860px!important;
    margin:22px auto 0!important;
  }

  #giftApplyForm .gapply-v3-submit-wrap button{
    width:100%!important;
    min-height:60px!important;
    border-radius:15px!important;
  }
}

/* 761~1023 태블릿/작은 PC: 너무 벌어지지 않게 */
@media(min-width:761px) and (max-width:1023px){
  #giftApplyForm.gapply-pc-normalized{
    max-width:760px!important;
    margin:0 auto!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-fields{
    margin-left:0!important;
  }

  #giftApplyForm .pc-add-button{
    margin-left:0!important;
    width:100%!important;
  }

  #giftApplyForm .pc-amount-input{
    margin-left:0!important;
    width:100%!important;
  }
}


/* =========================================================
   v1.6 PC MODAL SCOPE FIX
   중요:
   PC 보정은 "팝업 내부"에서만 적용.
   메인 페이지에 놓인 원본 giftApplyForm에는 절대 적용하지 않음.
   ========================================================= */

@media(min-width:761px){

  /* Main page form: remove previous desktop normalizer influence */
  body:not(.gexchange-modal-open) #giftApplyForm{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
  }

  body:not(.gexchange-modal-open) #giftApplyForm .pc-pin-fields,
  body:not(.gexchange-modal-open) #giftApplyForm .pc-add-button,
  body:not(.gexchange-modal-open) #giftApplyForm .pc-amount-input{
    width:auto!important;
    max-width:none!important;
    margin:initial!important;
    padding:initial!important;
  }

  /* Modal form */
  .gexchange-modal__body #giftApplyForm.gapply-pc-normalized{
    width:min(100%, 880px)!important;
    max-width:880px!important;
    margin:0 auto!important;
    padding:0 0 32px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-balanced-section{
    width:100%!important;
    max-width:880px!important;
    margin:0 auto 20px!important;
    padding:24px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-toolbar{
    display:grid!important;
    grid-template-columns:110px 1fr!important;
    gap:18px!important;
    align-items:center!important;
    margin:0 0 16px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-toolbar .gapply-v3-pin-tools{
    display:flex!important;
    gap:10px!important;
    flex-wrap:wrap!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-toolbar button{
    min-width:170px!important;
    height:48px!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0 0 0 128px!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:12px!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields input{
    width:100%!important;
    height:58px!important;
    min-width:0!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-help{
    margin:10px 0 18px 128px!important;
    width:calc(100% - 128px)!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-amount-input{
    display:block!important;
    width:calc(100% - 128px)!important;
    max-width:none!important;
    height:56px!important;
    margin:0 0 14px 128px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-quick-section{
    width:100%!important;
    display:grid!important;
    grid-template-columns:110px 1fr!important;
    gap:18px!important;
    align-items:center!important;
    margin:0 0 18px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-quick-buttons{
    display:flex!important;
    gap:8px!important;
    flex-wrap:wrap!important;
    width:100%!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-quick-buttons button{
    min-width:88px!important;
    height:42px!important;
    width:auto!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-add-button{
    width:calc(100% - 128px)!important;
    max-width:none!important;
    height:52px!important;
    margin:0 0 20px 128px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-added-card{
    width:calc(100% - 128px)!important;
    margin:0 0 18px 128px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-summary-section{
    display:grid!important;
    grid-template-columns:110px 1fr 130px 1fr!important;
    gap:16px!important;
    align-items:center!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-account-section,
  .gexchange-modal__body #giftApplyForm .pc-password-section{
    display:grid!important;
    grid-template-columns:110px minmax(0,1fr)!important;
    gap:18px!important;
    align-items:start!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-account-fields{
    display:grid!important;
    grid-template-columns:1fr 1.05fr 1.05fr 86px 84px 84px!important;
    gap:8px!important;
    width:100%!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-account-fields input,
  .gexchange-modal__body #giftApplyForm .pc-account-fields select{
    width:100%!important;
    min-width:0!important;
    height:50px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-password-fields{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:12px!important;
  }

  .gexchange-modal__body #giftApplyForm .gapply-v3-submit-wrap{
    width:100%!important;
    max-width:880px!important;
    margin:22px auto 0!important;
  }
}


/* =========================================================
   v1.7 PC PIN 입력칸 좌측 정렬 + 폭 확대
   - PIN 입력칸 시작점을 아래 안내문구와 동일한 축에 맞춤
   - 4개 입력칸을 가용 폭 전체에 균등 분배
   - 모바일에는 영향 없음
   ========================================================= */
@media(min-width:1024px){

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields{
    width:calc(100% - 92px)!important;
    max-width:none!important;
    margin:0 0 10px 92px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    column-gap:12px!important;
    row-gap:12px!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields > *{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields input,
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields .gapply-v3-pin-part{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
    padding:0 14px!important;
    text-align:center!important;
    font-size:17px!important;
  }

  /* 입력 안내문구도 PIN 입력칸과 정확히 같은 시작점 */
  .gexchange-modal__body #giftApplyForm .pc-pin-help{
    width:calc(100% - 92px)!important;
    max-width:none!important;
    margin:10px 0 18px 92px!important;
    padding:0!important;
    text-align:left!important;
  }

  /* 금액 입력/추가 버튼도 동일한 좌측 기준선으로 통일 */
  .gexchange-modal__body #giftApplyForm .pc-amount-input{
    width:calc(100% - 92px)!important;
    margin-left:92px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-add-button{
    width:calc(100% - 92px)!important;
    margin-left:92px!important;
  }
}

@media(min-width:761px) and (max-width:1023px){
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:10px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-help{
    width:100%!important;
    margin:10px 0 18px!important;
  }
}


/* =========================================================
   v1.8 PC PIN responsive width
   - PIN 입력칸과 안내문구 시작점 완전 일치
   - 1칸/2칸/3칸/4칸 상품권별 가독성 있는 폭 자동 배분
   - 컬쳐랜드 교환권 / 북앤라이프 도서문화상품권 대응
   ========================================================= */
@media(min-width:1024px){

  /*
   * 공통 기준축:
   * PIN 라벨 영역 150px을 제외한 나머지 영역을 입력부로 사용
   */
  .gexchange-modal__body #giftApplyForm .pc-pin-toolbar{
    grid-template-columns:150px minmax(0,1fr)!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-fields{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:0 0 10px 150px!important;
    padding:0!important;
    gap:12px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-pin-help{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:10px 0 18px 150px!important;
    padding:0!important;
    text-align:left!important;
  }

  /*
   * 4칸 상품권: 4열 균등
   * 예: 컬쳐랜드 문화상품권
   */
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-4{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  /*
   * 3칸 상품권: 3열 균등
   * 예: 틴캐시 12자리 4+4+4
   */
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-3{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  /*
   * 2칸 상품권:
   * 첫 번째 PIN번호는 넓게, 두 번째 인증번호는 적당한 폭
   * 예: 북앤라이프 도서문화상품권
   */
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-2{
    display:grid!important;
    grid-template-columns:minmax(420px,2.2fr) minmax(180px,1fr)!important;
  }

  /*
   * 1칸 상품권:
   * 12~13자리 PIN 입력을 한 칸에 넓게 표시
   * 예: 컬쳐랜드 교환권
   */
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-1{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    max-width:760px!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-1 > *,
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-1 input{
    width:100%!important;
    max-width:none!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-2 > *,
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-2 input{
    width:100%!important;
    max-width:none!important;
  }

  /* 1/2칸 상품권은 긴 PIN을 읽기 쉽게 좌측 정렬 */
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-1 input,
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-2 input:first-child{
    text-align:left!important;
    padding-left:18px!important;
    letter-spacing:.02em!important;
  }

  /* 금액 입력과 추가버튼도 PIN 안내문구 기준선과 맞춤 */
  .gexchange-modal__body #giftApplyForm .pc-amount-input{
    width:calc(100% - 150px)!important;
    margin-left:150px!important;
  }

  .gexchange-modal__body #giftApplyForm .pc-add-button{
    width:calc(100% - 150px)!important;
    margin-left:150px!important;
  }
}

@media(min-width:761px) and (max-width:1023px){
  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-1{
    grid-template-columns:1fr!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-2{
    grid-template-columns:2fr 1fr!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-3{
    grid-template-columns:repeat(3,1fr)!important;
  }

  .gexchange-modal__body #giftApplyForm #giftPinFields.pc-pin-count-4{
    grid-template-columns:repeat(4,1fr)!important;
  }
}


/* =========================================================
   v1.9 PC PIN ALIGN - MAIN + MODAL
   이전 버전이 modal 내부에만 적용되던 문제 수정.
   메인 내장형 신청폼과 팝업 신청폼 모두 동일하게 적용.
   ========================================================= */
@media(min-width:1024px){

  /* PIN 전체 입력 영역의 기준선 */
  #giftApplyForm #giftPinFields{
    box-sizing:border-box!important;
    padding:0!important;
    gap:12px!important;
  }

  /* 4칸: 아래 안내문구와 같은 시작점 + 전체 가용폭 사용 */
  #giftApplyForm #giftPinFields.pc-pin-count-4{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:0 0 10px 150px!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  /* 3칸 */
  #giftApplyForm #giftPinFields.pc-pin-count-3{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:0 0 10px 150px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  /* 2칸: 긴 PIN + 인증번호 */
  #giftApplyForm #giftPinFields.pc-pin-count-2{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:0 0 10px 150px!important;
    display:grid!important;
    grid-template-columns:minmax(420px,2.2fr) minmax(180px,1fr)!important;
  }

  /* 1칸: 긴 PIN 번호를 넓게 */
  #giftApplyForm #giftPinFields.pc-pin-count-1{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:0 0 10px 150px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }

  #giftApplyForm #giftPinFields > *{
    min-width:0!important;
    max-width:none!important;
    width:100%!important;
    margin:0!important;
  }

  #giftApplyForm #giftPinFields input,
  #giftApplyForm #giftPinFields .gapply-v3-pin-part{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
    box-sizing:border-box!important;
    font-size:17px!important;
  }

  /* 1칸/2칸의 긴 번호는 좌측 정렬 */
  #giftApplyForm #giftPinFields.pc-pin-count-1 input,
  #giftApplyForm #giftPinFields.pc-pin-count-2 input:first-of-type{
    text-align:left!important;
    padding-left:18px!important;
  }

  /* 안내문구를 PIN 입력 시작점과 정확히 일치 */
  #giftApplyForm .pc-pin-help{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin:10px 0 18px 150px!important;
    padding:0!important;
    text-align:left!important;
  }

  /* 금액 입력 및 추가버튼도 동일한 세로축 */
  #giftApplyForm .pc-amount-input{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin-left:150px!important;
  }

  #giftApplyForm .pc-add-button{
    width:calc(100% - 150px)!important;
    max-width:none!important;
    margin-left:150px!important;
  }
}


/* =========================================================
   v4.0 RECOVERY PATCH
   구조를 변경하지 않고, 정상 동작하던 기존 폼 위에 PC 폭만 보정.
   ========================================================= */
@media(min-width:1024px){

  /* PIN 입력칸은 정상 구조를 유지하면서 약간 왼쪽/넓게 */
  #giftApplyForm #giftPinFields.pc-pin-count-4,
  #giftApplyForm #giftPinFields.pc-pin-count-3,
  #giftApplyForm #giftPinFields.pc-pin-count-2,
  #giftApplyForm #giftPinFields.pc-pin-count-1{
    max-width:none!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-count-4{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-count-3{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-count-2{
    grid-template-columns:minmax(380px,2fr) minmax(180px,1fr)!important;
  }

  #giftApplyForm #giftPinFields.pc-pin-count-1{
    grid-template-columns:minmax(0,1fr)!important;
  }

  /* 금액 입력란은 너무 작지 않게 */
  #giftApplyForm .pc-amount-input{
    min-width:420px!important;
    max-width:640px!important;
    height:56px!important;
  }
}


/* =========================================================
   v5.0 LAYOUT STABILITY FIX
   동영상 분석 결과:
   - 메인에서 처음에는 정상
   - 교환 팝업으로 form이 이동한 뒤 폭이 급격히 축소
   - 팝업을 닫은 뒤 메인에서도 축소 상태가 남음
   원인: JS가 form 이동 시 계산한 폭/마진을 inline !important로 반복 적용.
   해결: 해당 JS를 제거하고 CSS만으로 레이아웃 고정.
   ========================================================= */

/* JS가 과거 세션/브라우저 복원에서 남긴 inline style보다 우선 */
#giftApplyForm,
#giftApplyForm *{
  box-sizing:border-box;
}

/* ---------- PC ---------- */
@media(min-width:1024px){

  #giftApplyForm{
    width:100%!important;
    max-width:none!important;
  }

  /* PIN 블록은 부모 폭 전체를 사용 */
  #giftApplyForm #giftPinFields{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    gap:12px!important;
  }

  /* 기본은 4열 */
  #giftApplyForm #giftPinFields{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  /* 1개 입력 */
  #giftApplyForm #giftPinFields:not(:has(input:nth-of-type(2))){
    grid-template-columns:minmax(0,1fr)!important;
  }

  /* 2개 입력 */
  #giftApplyForm #giftPinFields:has(input:nth-of-type(2)):not(:has(input:nth-of-type(3))){
    grid-template-columns:minmax(420px,2fr) minmax(190px,1fr)!important;
  }

  /* 3개 입력 */
  #giftApplyForm #giftPinFields:has(input:nth-of-type(3)):not(:has(input:nth-of-type(4))){
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  #giftApplyForm #giftPinFields > *,
  #giftApplyForm #giftPinFields input,
  #giftApplyForm #giftPinFields .gapply-v3-pin-part{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:58px!important;
    margin:0!important;
  }

  /* PIN 번호가 긴 1/2칸 상품권은 읽기 쉽게 */
  #giftApplyForm #giftPinFields:not(:has(input:nth-of-type(2))) input,
  #giftApplyForm #giftPinFields:has(input:nth-of-type(2)):not(:has(input:nth-of-type(3))) input:first-of-type{
    text-align:left!important;
    padding-left:18px!important;
  }

  /* 안내문구 */
  #giftApplyForm #giftPinFields + *,
  #giftApplyForm .gapply-v3-pin-help,
  #giftApplyForm .pc-pin-help{
    max-width:none!important;
  }

  /* 금액 입력란 */
  #giftApplyForm input[name*="amount"],
  #giftApplyForm input[placeholder*="상품권 금액"],
  #giftApplyForm input[placeholder*="금액 입력"]{
    width:min(100%,680px)!important;
    max-width:680px!important;
    min-width:420px!important;
    height:56px!important;
  }

  /* 빠른금액 */
  #giftApplyForm .gapply-v3-quick-amounts,
  #giftApplyForm .pc-quick-buttons{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    width:auto!important;
    max-width:none!important;
  }

  #giftApplyForm .gapply-v3-quick-amounts button,
  #giftApplyForm .pc-quick-buttons button{
    width:auto!important;
    min-width:76px!important;
    height:40px!important;
  }

  /* 추가버튼 */
  #giftApplyForm .gapply-v3-add,
  #giftApplyForm .gapply-v3-add-mobile,
  #giftApplyForm .pc-add-button{
    width:min(100%,680px)!important;
    max-width:680px!important;
    min-width:420px!important;
    height:52px!important;
  }

  /* 팝업에서도 같은 폼 폭을 사용 */
  .gexchange-modal__body #giftApplyForm{
    width:100%!important;
    max-width:900px!important;
    margin:0 auto!important;
  }
}

/* ---------- 모바일 ---------- */
@media(max-width:760px){

  #giftApplyForm #giftPinFields{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }

  #giftApplyForm #giftPinFields > *,
  #giftApplyForm #giftPinFields input{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }

  .gexchange-modal__body{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch!important;
  }

  .gexchange-modal__body #giftApplyForm{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    padding-bottom:80px!important;
  }
}


/* =========================================================
   v5.2 PC 금액 입력 + 추가 버튼 가독성 보정
   - 긴 PIN 상품권(1~2칸)에서도 금액 영역을 충분히 넓게 표시
   - + 버튼은 금액 입력란 오른쪽에 균형 있게 배치
   - 모바일에는 영향 없음
   ========================================================= */
@media(min-width:1024px){

  /*
   * 금액 입력/추가 버튼이 들어있는 행:
   * 입력란을 넓게, + 버튼은 고정 폭으로 정렬.
   */
  #giftApplyForm .gapply-v3-amount-row,
  #giftApplyForm .gapply-v3-amount-wrap,
  #giftApplyForm .gapply-v3-amount-controls{
    display:grid!important;
    grid-template-columns:minmax(420px, 1fr) 120px!important;
    gap:12px!important;
    align-items:center!important;
    width:min(100%, 760px)!important;
    max-width:760px!important;
  }

  /* 실제 상품권 금액 입력란 */
  #giftApplyForm input[name*="amount"],
  #giftApplyForm input[placeholder*="상품권 금액"],
  #giftApplyForm input[placeholder*="금액 입력"]{
    width:100%!important;
    max-width:640px!important;
    min-width:460px!important;
    height:58px!important;
    margin:0!important;
    padding:0 18px!important;
    border-radius:13px!important;
    font-size:15px!important;
    box-sizing:border-box!important;
  }

  /* + 추가 버튼 */
  #giftApplyForm .gapply-v3-add,
  #giftApplyForm .gapply-v3-add-mobile,
  #giftApplyForm button[data-add-item],
  #giftApplyForm button[data-gift-add],
  #giftApplyForm .pc-add-button{
    width:120px!important;
    min-width:120px!important;
    max-width:120px!important;
    height:58px!important;
    margin:0!important;
    padding:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:13px!important;
    font-size:25px!important;
    font-weight:800!important;
    line-height:1!important;
    letter-spacing:0!important;
  }

  /*
   * 클래스가 없는 실제 + 버튼도 대응.
   * :has()로 금액 input과 같은 부모 안의 버튼만 지정.
   */
  #giftApplyForm div:has(
    > input[placeholder*="상품권 금액"]
  ){
    display:grid!important;
    grid-template-columns:minmax(420px, 1fr) 120px!important;
    gap:12px!important;
    align-items:center!important;
    width:min(100%, 760px)!important;
    max-width:760px!important;
  }

  #giftApplyForm div:has(
    > input[placeholder*="상품권 금액"]
  ) > button{
    width:120px!important;
    min-width:120px!important;
    max-width:120px!important;
    height:58px!important;
    margin:0!important;
    border-radius:13px!important;
    font-size:25px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* =========================================================
   v5.3 불필요한 하단 "+ 추가" 버튼 제거
   금액 입력창 오른쪽의 검정색 + 버튼은 유지합니다.
   ========================================================= */
@media(min-width:761px){
  #giftApplyForm button.gapply-v3-add-mobile{
    display:none!important;
  }
}
