/* V53_RESPONSIVE_FIX_V1 */
/* V52 화면 구성은 유지하고, 화면 폭 축소 시 넘침·겹침만 제어한다. */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

#hb-ui-prototype-root,
#hb-ui-prototype-root .hb-content,
#hb-ui-prototype-root .hb-content > *,
#hb-ui-prototype-root .hb-grid,
#hb-ui-prototype-root .hb-card,
#hb-ui-prototype-root .hb-padded,
#hb-ui-prototype-root .hb-form-card,
#hb-ui-prototype-root .hb-module-overview {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* 표만 가로 스크롤하고, 페이지 전체가 옆으로 밀리지 않게 한다. */
#hb-ui-prototype-root .hb-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

#hb-ui-prototype-root .hb-table {
  min-width: 680px;
}

/* 긴 제목·설명·버튼이 콘텐츠 바깥으로 나가지 않게 한다. */
#hb-ui-prototype-root .hb-content-head,
#hb-ui-prototype-root .hb-card-title,
#hb-ui-prototype-root .hb-module-overview,
#hb-ui-prototype-root .hb-head-actions,
#hb-ui-prototype-root .hb-row-actions,
#hb-ui-prototype-root .hb-form-bottom-actions {
  min-width: 0;
}

#hb-ui-prototype-root .hb-content-head h1,
#hb-ui-prototype-root .hb-content-head p,
#hb-ui-prototype-root .hb-card-title h2,
#hb-ui-prototype-root .hb-card-title b,
#hb-ui-prototype-root .hb-module-overview strong,
#hb-ui-prototype-root .hb-module-overview span {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* 안내 테두리는 화면 밖으로 넘치지 않게 제한한다. */
#hb-all-tabs-detail-guide,
#hb-all-tabs-detail-guide .hb-detail-guide {
  max-width: 100vw;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  #hb-ui-prototype-root .hb-content {
    padding: 22px 18px 32px;
  }

  #hb-ui-prototype-root .hb-content-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  #hb-ui-prototype-root .hb-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #hb-ui-prototype-root .hb-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  #hb-ui-prototype-root .hb-filterbar label,
  #hb-ui-prototype-root .hb-filterbar label.grow {
    min-width: min(220px, 100%);
  }
}

@media (max-width: 760px) {
  #hb-ui-prototype-root .hb-content {
    padding: 16px 12px 26px;
  }

  #hb-ui-prototype-root .hb-content-head h1 {
    font-size: 23px;
    line-height: 1.25;
  }

  #hb-ui-prototype-root .hb-head-actions,
  #hb-ui-prototype-root .hb-row-actions,
  #hb-ui-prototype-root .hb-form-bottom-actions {
    gap: 6px;
  }

  #hb-ui-prototype-root .hb-head-actions .hb-btn,
  #hb-ui-prototype-root .hb-form-bottom-actions button {
    flex: 1 1 130px;
  }

  #hb-ui-prototype-root .hb-filterbar {
    padding: 11px;
    gap: 9px;
  }

  #hb-ui-prototype-root .hb-filterbar label,
  #hb-ui-prototype-root .hb-filterbar label.grow {
    flex: 1 1 100%;
    min-width: 100%;
  }

  #hb-ui-prototype-root .hb-stat-grid,
  #hb-ui-prototype-root .hb-grid.two {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #hb-ui-prototype-root .hb-card-title,
  #hb-ui-prototype-root .hb-padded,
  #hb-ui-prototype-root .hb-form-card {
    padding-left: 13px;
    padding-right: 13px;
  }

  #hb-ui-prototype-root .hb-tabs {
    margin-inline: -2px;
    padding-bottom: 10px;
  }

  /* 휴대폰에서는 숫자를 유지하되 설명 라벨은 겹침 방지를 위해 숨긴다. */
  #hb-all-tabs-detail-guide .hb-detail-guide {
    border-width: 1px;
  }

  #hb-all-tabs-detail-guide .hb-detail-guide-badge {
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    font-size: 10px;
  }

  #hb-all-tabs-detail-guide .hb-detail-guide-label {
    display: none !important;
  }
}

@media (max-width: 420px) {
  #hb-ui-prototype-root .hb-content {
    padding-inline: 10px;
  }

  #hb-ui-prototype-root .hb-head-actions .hb-btn,
  #hb-ui-prototype-root .hb-form-bottom-actions button {
    flex-basis: 100%;
  }

  #hb-ui-prototype-root .hb-module-overview {
    gap: 10px;
    padding: 12px;
  }

  #hb-ui-prototype-root .hb-module-overview-number {
    flex-basis: 34px;
    height: 34px;
    font-size: 14px;
  }
}
