/* 결제 관리: 좁은 뷰포트에서 가로 2열을 세로로 쌓고 한글은 어절 단위로 줄바꿈 */
.pay-mgmt,
.pay-mgmt-panel {
  word-break: keep-all;
  overflow-wrap: break-word;
}
.pay-mgmt-panel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pay-mgmt-top-bar { display: none; }
@media (max-width: 768px) {
  .pay-mgmt-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin: 16px 0 16px;
    padding: 0 16px;
  }
  .pay-mgmt-top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .pay-mgmt-top-bar .btn-mobile-inquiry,
  .pay-mgmt-top-bar .setting-mobile-back,
  .pay-mgmt-top-bar .pay-mgmt-top-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 96px;
    min-height: 36px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    border: none;
    border-radius: 24px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    -webkit-tap-highlight-color: transparent;
    transform: none;
    cursor: pointer;
  }
  .pay-mgmt-top-bar .pay-mgmt-top-logout,
  .mobile-top-bar .btn-mobile-logout,
  .header-logout-btn.header-mobile-only {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    box-shadow: none;
    min-width: 96px;
    min-height: 36px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    border-radius: 24px;
    cursor: pointer;
    white-space: nowrap;
    gap: 0;
  }
  .mobile-top-bar .btn-mobile-logout,
  .header-logout-btn.header-mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  .pay-mgmt-top-bar .btn-mobile-inquiry:active,
  .pay-mgmt-top-bar .setting-mobile-back:active {
    background: #1d4ed8;
  }
  .pay-mgmt-top-bar .pay-mgmt-top-logout:active,
  .mobile-top-bar .btn-mobile-logout:active,
  .header-logout-btn.header-mobile-only:active {
    background: #fef2f2;
  }
  .pay-mgmt-top-bar .pay-mgmt-top-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 36px;
    padding: 7px 12px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }
  .pay-mgmt-top-bar .pay-mgmt-top-settings i { font-size: 15px; }
  .pay-mgmt-logout {
    display: none !important;
  }
}

.pay-mgmt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: #ffffff;
  padding: 24px;
  border-bottom: 1px solid #e0e0e0;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
.pay-mgmt-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 600;
  color: #212529;
  word-break: keep-all;
}
.pay-mgmt-logout {
  display: none;
}
.pay-mgmt-body {
  background-color: #ffffff;
  padding: 24px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.pay-mgmt {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.pay-mgmt-section {
  padding: 24px;
}
.pay-mgmt-label {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 4px;
  word-break: keep-all;
}
.pay-mgmt-plan-row,
.pay-mgmt-method-row,
.pay-mgmt-cancel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pay-mgmt-plan-info,
.pay-mgmt-method-info {
  min-width: 0;
}
.pay-mgmt-plan-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pay-mgmt-plan-badge {
  display: inline-block;
  padding: 6px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 16px;
  white-space: nowrap;
}
.pay-mgmt-plan-badge--none {
  background-color: #9ca3af;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.pay-mgmt-plan-badge--plan {
  background-color: #4682b4;
  box-shadow: 0 2px 6px rgba(70, 130, 180, 0.25);
}
.pay-mgmt-usage-btn {
  display: none;
}
#payUsageModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10080;
  background: #000;
  padding: 0;
}
#payUsageModal.is-open { display: flex; }
#payUsageModal .pay-usage-modal-dialog {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#payUsageModal .pay-usage-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #dfe1e3;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
#payUsageModal .pay-usage-modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
#payUsageModal .pay-usage-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#payUsageModal .pay-usage-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}
.pay-mgmt-plan-actions,
.pay-mgmt-method-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
}
.pay-mgmt-method-actions {
  flex-direction: row;
  align-items: center;
}
.pay-mgmt-btn {
  word-break: keep-all;
  white-space: nowrap;
  box-sizing: border-box;
}
.pay-mgmt-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.pay-mgmt-field-value {
  font-weight: 600;
  color: #212529;
  word-break: keep-all;
}
.pay-mgmt-method-block,
.pay-mgmt-cancel-block {
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}
.pay-mgmt-method-value {
  font-size: 16px;
  font-weight: 500;
  color: #212529;
  word-break: keep-all;
}

@media (max-width: 768px) {
  .main-area:has([data-testid="payment-management-panel"]) {
    padding-left: 12px;
    padding-right: 12px;
  }
  .pay-mgmt-header,
  .pay-mgmt-body {
    padding: 16px;
  }
  .pay-mgmt-section {
    padding: 0;
  }
  .pay-mgmt {
    gap: 20px;
  }
  .pay-mgmt-title {
    font-size: 18px;
  }
  .pay-mgmt-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #dc2626;
    background: none;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    word-break: keep-all;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .pay-mgmt-logout:active {
    background: #fef2f2;
  }
  .pay-mgmt-plan-row,
  .pay-mgmt-method-row,
  .pay-mgmt-cancel-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pay-mgmt-usage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
    padding: 8px 16px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  .pay-mgmt-usage-btn:active {
    background: #dbeafe;
  }
  .pay-mgmt-plan-actions,
  .pay-mgmt-method-actions {
    width: 100%;
    flex-direction: column;
  }
  .pay-mgmt-btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
  .pay-mgmt-fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pay-mgmt-cancel-row > div:empty {
    display: none;
  }
}
